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
vaadin-combo-box when placed inside paper-dialog is closing the dialog in some cases. #405
Comments
There is a kind of bug with events propagation. E. g. closing
There's also a |
I can't find where to place the event that will call |
Hi there! The challenge here is that the overlay of As a workaround, you can disable the outside clicks when the combo-box is open: ...
<vaadin-combo-box id="third" label="Focus Third" tabindex="3" on-focus="_focusInput" items="[[items]]" on-blur="_onBlur" on-opened-changed="_onComboBoxOpened">
</vaadin-combo-box>
<script>
...
_onComboBoxOpened: function(e) {
if (e.detail.value) {
this.$.add_row_details_dialog.noCancelOnOutsideClick = true;
} else {
this.async(function() {
this.$.add_row_details_dialog.noCancelOnOutsideClick = false;
}, 10);
}
}
...
</script> |
@Saulis, your approach didn't work for me, unfortunately. However, I just set the noCancelOnOutsideClick property to true on the paper-dialog, and that fixes the problem (there was no requirement to close the dialog when you click outside of it, in this case). |
FYI, this also happens if you just select an item in the combo box using your mouse... |
Apply 'no-cancel-on-outside-click' to paper-dialog element. This will prevent dialog from closing when you selected element in the vaadin-combo-box by mouseclick or from keyboard.
|
@kito99 / @artem-vladimirov's workaround with no-cancel-on-outside-click is not suitable in general or for me, since I want the user to be able to close the dialog with an outside click. (But I can confirm that it works if that is not a requirement). Another (similar) workaround is to listen for the I've tried to differentiate the two events from each other but no luck so far. I can confirm @kito99's observation that just selecting an item closes the dialog, and so does canceling the selection by clicking on the paper-dialog. EDIT: I came up with the following workaround:
In short, the event is canceled only if the cursor is on the paper-dialog or on the overlay element. With this workaround I can select dropdown values, close the dialog with an outside click and also close the dialog with the escape button. Tested on Chrome and Firefox. |
Is there something to do here besides to wait a new version? official vaadin workaround? |
Not sure why I’ve completely missed this issue for so long. This is a really fundamental usability problem and should be fixed asap. I’ll see if I can inspire @Saulis or someone else from the dev team to take a look this or next week. |
Hey guys, please try out the branch I also cherry-picked the change on top of the Update: this fix probably works only on |
@GoceRibeski @web-padawan @kito99 @artem-vladimirov @panuhorsmalahti @timoteoponce anybody have a chance to try the fix out? Thanks! |
@Saulis Thanks for reminding. I just grabbed the
So, after having both
I have not much time to investigate right now, but guess that missing listener might be the reason. |
@web-padawan thanks! no need to worry about the missing |
@web-padawan I can confirm that the fix does work for me both on |
@Saulis It doesn't work for me. In fact I even have a weird bug that is not present on 2.0a4. All the text from my template disappears I'm running Polymer 2 with Here is |
@arkihillel I've rebased |
Seems to work for me. Btw, not a big deal, but you may have made a typo with |
@Saulis Works now! |
Is there already a stable solution ? |
Description
When
vaadin-combo-box
element is placed inside paper-dialog, if user opens the box for selection(but does not select, just leaves it opened ) then click anywhere in the dialog closes the dialog.Expected outcome
Click anywhere in the dialog( pr. top left corner) should close the box, but leave the dialog opened.
Actual outcome
Click anywhere in the dialog closes the whole dialog.
Live Demo
https://jsfiddle.net/ribe/02tntfn3/2/
Steps to reproduce
3.Click on the top left corner of the dialog.
The text was updated successfully, but these errors were encountered: