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

revert blur and focus on last chip delete #24

Merged
merged 1 commit into from
Sep 18, 2020
Merged

revert blur and focus on last chip delete #24

merged 1 commit into from
Sep 18, 2020

Conversation

nicknickel
Copy link

Proposed changes

This is a re-implementation of Dogfalo#6324.

Original problem statement:
If you have focused on a chip and then un-focus the entire browser window (not focusing on another element) the _handleChipsBlur function is executed. This sets null in _selectedChip but when you return to the window the chip retains its focus. If you try to hit the left, right and delete keys nothing is executed (in delete an exception is thrown).

  • This fix checks for document.hidden and does not unselect the chip if the document is in fact hidden.
  • Also introduces a minor update that focuses the input element when deleting the last chip.

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@nicknickel nicknickel marked this pull request as ready for review September 14, 2020 22:29
@nicknickel nicknickel requested a review from a team September 14, 2020 22:30
Copy link
Member

@Smankusors Smankusors left a comment

Choose a reason for hiding this comment

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

in case someone can't trigger this bug, the bug isn't triggered if you use Alt+Tab... at least on me

@Smankusors Smankusors merged commit 7f13957 into materializecss:v1-dev Sep 18, 2020
JayDijkstra pushed a commit to JayDijkstra/materialize that referenced this pull request Mar 7, 2021
@Smankusors Smankusors added the bug Something isn't working label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants