-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added fix to avoid showing style on focus when hover behavior is… #470
Conversation
|
||
.upf-infinite-select__item--disabled-focus { | ||
&:hover { | ||
background-color: var(--color-gray-100); |
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.
Isn't it already handled by the line 33 ?
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.
Yep you're right, removed it 👌
|
||
&:focus { | ||
outline: none; | ||
background-color: white; |
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.
Nit: Use css var
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.
Changed to var
@@ -135,6 +149,19 @@ export default class OSSInfiniteSelect extends Component<InfiniteSelectArgs> { | |||
} | |||
} | |||
|
|||
@action | |||
handleItemHover(index: number) { |
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.
missing return type
handleItemHover(index: number): void { | ||
this._focusElementAt(index); | ||
this._focusElement = index; | ||
console.log(this._focusElement, index); |
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.
console.log alert!
Description:
https://www.loom.com/share/2b8370d959224143b6cb4c0b6c7c9439?sid=beefde54-cce9-47ab-9f99-127d0b81a0a9
Currently, when opening the infinite-select, the first element is focused and keeps its focus even when hovering over an element, making it where 3 elements can have a background grey at the same time.
Now, on opening the select, the first element is no longer focused. Selected item no longer has a grey background either.
When we hover, background styles from hover take over the keyboard navigation styles.
When we navigate with the keyboard, keyboard background styles take over the hover background styles.
What does this PR do?
Related to: #
What are the observable changes?
Good PR checklist