-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3441 from parasharrajat/edit-box
Set the focus on Edit Box after edit action.
- Loading branch information
Showing
8 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import _ from 'underscore'; | ||
|
||
let focusCallback = null; | ||
|
||
/** | ||
* Register a callback to be called when focus is requested. | ||
* Typical uses of this would be call the focus on the ReportActionComposer. | ||
* | ||
* @param {Function} callback callback to register | ||
*/ | ||
function onComposerFocus(callback) { | ||
focusCallback = callback; | ||
} | ||
|
||
/** | ||
* Request focus on the ReportActionComposer | ||
* | ||
*/ | ||
function focus() { | ||
if (_.isFunction(focusCallback)) { | ||
focusCallback(); | ||
} | ||
} | ||
|
||
/** | ||
* Clear the registered focus callback | ||
* | ||
*/ | ||
function clear() { | ||
focusCallback = null; | ||
} | ||
|
||
export default { | ||
onComposerFocus, | ||
focus, | ||
clear, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters