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

Added fix to avoid showing style on focus when hover behavior is… #470

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

OwenCoogan
Copy link
Contributor

@OwenCoogan OwenCoogan commented Jan 16, 2025

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

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Migrated touched components to Glimmer Components
  • Properly labeled

@OwenCoogan OwenCoogan self-assigned this Jan 16, 2025
Copy link

linear bot commented Jan 16, 2025


.upf-infinite-select__item--disabled-focus {
&:hover {
background-color: var(--color-gray-100);
Copy link
Contributor

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 ?

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Use css var

Copy link
Contributor Author

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) {
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log alert!

@OwenCoogan OwenCoogan merged commit 31ee447 into master Jan 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants