-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix/73489 - Two dates highlighted when scrolling date list with keyboard arrows on Freq list #74306
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
Changes from all commits
09890aa
5006837
e314bf8
fc5a58e
09806e8
ef88fb3
76b631a
0f0edb5
b7e932b
f3c1882
bc3b846
dfc57af
195bc3f
236a55a
53bb4b6
9fa5544
6883488
f50a560
9acd689
7c1a983
2bdb551
7e0980a
6abe191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import React, {useRef} from 'react'; | |
| import {View} from 'react-native'; | ||
| import {getButtonRole} from '@components/Button/utils'; | ||
| import Icon from '@components/Icon'; | ||
| // eslint-disable-next-line no-restricted-imports | ||
| import * as Expensicons from '@components/Icon/Expensicons'; | ||
| import OfflineWithFeedback from '@components/OfflineWithFeedback'; | ||
| import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; | ||
|
|
@@ -44,6 +45,8 @@ function BaseListItem<TItem extends ListItem>({ | |
| forwardedFSClass, | ||
| shouldShowRightCaret = false, | ||
| shouldHighlightSelectedItem = true, | ||
| shouldDisableHoverStyle, | ||
| shouldStopMouseLeavePropagation = true, | ||
| }: BaseListItemProps<TItem>) { | ||
| const theme = useTheme(); | ||
| const styles = useThemeStyles(); | ||
|
|
@@ -57,7 +60,9 @@ function BaseListItem<TItem extends ListItem>({ | |
| useSyncFocus(pressableRef, !!isFocused, shouldSyncFocus); | ||
| const handleMouseLeave = (e: React.MouseEvent<Element, MouseEvent>) => { | ||
| bind.onMouseLeave(); | ||
| e.stopPropagation(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, but I think removing this one might cause a regression.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve added a prop passed down from |
||
| if (shouldStopMouseLeavePropagation) { | ||
| e.stopPropagation(); | ||
| } | ||
| setMouseUp(); | ||
| }; | ||
|
|
||
|
|
@@ -105,7 +110,7 @@ function BaseListItem<TItem extends ListItem>({ | |
| isNested | ||
| hoverDimmingValue={1} | ||
| pressDimmingValue={item.isInteractive === false ? 1 : variables.pressDimValue} | ||
| hoverStyle={[!item.isDisabled && item.isInteractive !== false && styles.hoveredComponentBG, hoverStyle]} | ||
| hoverStyle={!shouldDisableHoverStyle ? [!item.isDisabled && item.isInteractive !== false && styles.hoveredComponentBG, hoverStyle] : undefined} | ||
| dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true, [CONST.INNER_BOX_SHADOW_ELEMENT]: shouldShowBlueBorderOnFocus}} | ||
| onMouseDown={(e) => e.preventDefault()} | ||
| id={keyForList ?? ''} | ||
|
|
||
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.
Checklist from #79395:
We need to pass
shouldDisableHoverStyledown toUserListItemas well. Without passing it, we see two highlighted states when using keyboard arrow navigation.