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

fix(ui5-multi-combobox): close popover & empty value on selection #832

Merged
merged 7 commits into from
Oct 16, 2019

Conversation

fifoosid
Copy link
Contributor

No description provided.

@ilhan007 ilhan007 changed the title Multicombobox filtering fix(ui5-multi-combobox): close popover & empty value on selection Oct 10, 2019
ilhan007
ilhan007 previously approved these changes Oct 11, 2019
@ilhan007 ilhan007 dismissed their stale review October 11, 2019 05:10

if you focus the checkbox and press Enter I am not sure if this is count for using checkbox

@fifoosid
Copy link
Contributor Author

Fixes #768

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

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

Let`s add two basic tests, covering at least some of the logic
(1) focus on item and press Enter (selected, but multi closes)
(2) focus on item and press Space (selected, but multi remains open)

@@ -402,6 +404,12 @@ class MultiComboBox extends UI5Element {
});

this.fireEvent("selectionChange", { items: this._getSelectedItems() });

if (isEnter(event.detail) || (!event.detail.selectionComponentPressed && !isSpace(event.detail))) {
Copy link
Member

@ilhan007 ilhan007 Oct 14, 2019

Choose a reason for hiding this comment

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

I think you can remove the isEnter(event.detail) check, when the checkbox is on focus and Enter is pressed, selectionComponentPressed would be still false
and both conditions would be true:
isEnter(event.detail) - > true
!event.detail.selectionComponentPressed && !isSpace(event.detail)) - true

Let`s assume that pressing Enter on the Item or on the checkbox is the same for simplicity

@fifoosid fifoosid merged commit 1b3e40d into master Oct 16, 2019
@fifoosid fifoosid deleted the multicombobox-filtering branch October 16, 2019 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants