Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent focusing on composer while popover is open #28953

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/BaseMiniContextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ function BaseMiniContextMenuItem(props) {
return;
}

// Allow text input blur on right click
if (!e || e.button === 2) {
return;
}

// Prevent text input blur on left click
e.preventDefault();
}}
accessibilityLabel={props.tooltipText}
Expand Down
5 changes: 3 additions & 2 deletions src/components/LHNOptionsList/OptionRowLHN.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ function OptionRowLHN(props) {
props.onSelectRow(optionItem, popoverAnchor);
}}
onMouseDown={(e) => {
if (!e) {
// Allow composer blur on right click
if (!e || e.button === 2) {
return;
}

// Prevent losing Composer focus
// Prevent composer blur on left click
e.preventDefault();
}}
onSecondaryInteraction={(e) => showPopover(e)}
Expand Down
11 changes: 9 additions & 2 deletions src/components/Reactions/AddReactionBubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ function AddReactionBubble(props) {
ref={ref}
style={({hovered, pressed}) => [styles.emojiReactionBubble, styles.userSelectNone, StyleUtils.getEmojiReactionBubbleStyle(hovered || pressed, false, props.isContextMenu)]}
onPress={Session.checkIfActionIsAllowed(onPress)}
// Prevent text input blur when Add reaction is clicked
onMouseDown={(e) => e.preventDefault()}
onMouseDown={(e) => {
// Allow text input blur when Add reaction is right clicked
if (!e || e.button === 2) {
return;
}

// Prevent text input blur when Add reaction is left clicked
e.preventDefault();
}}
accessibilityLabel={props.translate('emojiReactions.addReactionTooltip')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
// disable dimming
Expand Down
Loading