-
Notifications
You must be signed in to change notification settings - Fork 196
fix: add clearTimeout to keyboard manager #275
Conversation
src/views/KeyboardManager.tsx
Outdated
@@ -14,6 +14,13 @@ export default class KeyboardManager extends React.Component<Props> { | |||
// When a gesture didn't change the tab, we can restore the focused input with this | |||
private previouslyFocusedTextInput: number | null = null; | |||
private startTimestamp: number = 0; | |||
private keyboardTimeout: NodeJS.Timer | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
is good
private keyboardTimeout: NodeJS.Timer | null = null; | |
private keyboardTimeout: NodeJS.Timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private keyboardTimeout: NodeJS.Timeout
src/views/KeyboardManager.tsx
Outdated
|
||
componentWillUnmount = () => { | ||
if (this.keyboardTimeout !== null) { | ||
global.clearTimeout(this.keyboardTimeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global.clearTimeout(this.keyboardTimeout); | |
clearTimeout(this.keyboardTimeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should also clear the time out on beginning of handlePageChangeStart
, handlePageChangeConfirm
and handlePageChangeCancel
in case there is another quick swipe after cancel?
@@ -14,8 +14,21 @@ export default class KeyboardManager extends React.Component<Props> { | |||
// When a gesture didn't change the tab, we can restore the focused input with this | |||
private previouslyFocusedTextInput: number | null = null; | |||
private startTimestamp: number = 0; | |||
private keyboardTimeout: NodeJS.Timeout | undefined; | |||
|
|||
clearKeyboardTimeout = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be private
No description provided.