Skip to content

fix: keydown events are prevented from bubbling in uui-table-cell #480

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

Merged
merged 2 commits into from
May 15, 2023

Conversation

iOvergaard
Copy link
Contributor

Description

Fixes #437

If an input field is placed inside a table cell, you cannot type spaces in the field due to the fact that the surrounding uui-table-row is listening on "keydown" events and preventing them from bubbling.

This PR aims to make all events in the SelectableMixin act the same way so that we do not interfer with native events.

However, one caveat is that placing a uui-input inside a uui-table-row that is selectable will select that row when you click inside the field. There does not seem to be a way to prevent this, since we can only check on the composedPath() to detect which element you clicked on due to the generics of how the SelectableMixin works. Nothing bad happens when you do this, but you need to be aware of this caveat.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

How to test?

  1. There is a story set up to test this scenario in for uui-table-row and uui-table-cell

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

neither the click event nor the unselect callback is being preventing the event from bubbling, so this change simply makes the keydown event bubble up
@iOvergaard iOvergaard added bug Something isn't working documentation Improvements or additions to documentation labels May 12, 2023
@iOvergaard iOvergaard requested a review from loivsen May 12, 2023 13:50
@iOvergaard iOvergaard merged commit d9cd3a0 into v1/contrib May 15, 2023
@iOvergaard iOvergaard deleted the v1/bugfix/selectable-preventdefault-keydown branch May 15, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UUI-INPUT doesn't display *spaces* if used inside UUI-TABLE
2 participants