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

feat(ui5-upload-collection-item): implement keyboard handling #1702

Merged
merged 7 commits into from
Jun 12, 2020

Conversation

fifoosid
Copy link
Contributor

@fifoosid fifoosid commented May 29, 2020

This change improves editing the name of file in ui5-upload-collection-item. On enter in the input and pressing the rename button, the name is saved. On pressing cancel in the input or escape the name is not changed.

Part of #1534

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

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

There are 2 bugs:

  • Esc doesn't close the rename input
  • When you press Enter after file rename, the focus is lost. The correct behavior is to set the focus on the whole item.

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

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

We never check for parentElement, this is an antipattern. Lists have similar interactions and they always use events. This way, even if children are slotted, it still works.
@ilhan007 can maybe point to examples?

In addition, clicking the Rename button with mouse (not enter) loses focus.

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

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

Final step :) looks much better, please make this more generic
I've proposed a name that would fit and be universal and usable for others as well

packages/main/src/List.js Outdated Show resolved Hide resolved
@fifoosid fifoosid merged commit 37bf177 into master Jun 12, 2020
@fifoosid fifoosid deleted the uc-keyboard-handling branch June 12, 2020 08:00
@ilhan007 ilhan007 added this to 1.0.0-rc.8 (released) in UI5 Web Components - Roadmap Aug 7, 2020
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.

None yet

2 participants