-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #7390 from parasharrajat/composerHide
Hide the composer when message is edited
- Loading branch information
Showing
7 changed files
with
41 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import _ from 'underscore'; | ||
import canUseTouchScreen from '../canUseTouchscreen'; | ||
|
||
/** | ||
* Is the virtual keyboard open? | ||
* | ||
* @returns {Boolean|null} – null if the VirtualKeyboard API is unavailable | ||
*/ | ||
function isOpen() { | ||
if (!_.has(navigator, 'virtualKeyboard')) { | ||
return null; | ||
} | ||
return navigator.virtualKeyboard.boundingRect.y > 0; | ||
} | ||
|
||
/** | ||
* As of January 2022, the VirtualKeyboard web API is not available in all browsers yet | ||
* If it is unavailable, we default to assuming that the virtual keyboard is open on touch-enabled devices. | ||
* See https://github.com/Expensify/App/issues/6767 for additional context. | ||
* | ||
* @returns {Boolean} | ||
*/ | ||
function shouldAssumeIsOpen() { | ||
const isOpened = isOpen(); | ||
return _.isNull(isOpened) ? canUseTouchScreen() : isOpened; | ||
} | ||
|
||
export default { | ||
isOpen, | ||
shouldAssumeIsOpen, | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
src/libs/toggleReportActionComposeView.js → ...bs/toggleReportActionComposeView/index.js
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,3 @@ | ||
import * as Session from '../actions/Session'; | ||
|
||
export default shouldShowComposeInput => Session.setShouldShowComposeInput(shouldShowComposeInput); |
This file was deleted.
Oops, something went wrong.
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