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

[select] Add public API to set no-vertical-overlap on the overlay #5101

Closed
probert94 opened this issue Dec 5, 2022 · 4 comments
Closed

[select] Add public API to set no-vertical-overlap on the overlay #5101

probert94 opened this issue Dec 5, 2022 · 4 comments
Labels
enhancement New feature or request needs design Design is needed UX User experience issue vaadin-select workaround There is a workaround in the comments.

Comments

@probert94
Copy link

Describe your motivation

I recently got the feedback that some users unintentionally change the value of the Select component because the overlay opens above the component and the first value is directly under the cursor:
image
image

So a double click in this case would set the value from "Price: low to high" to "Most recent first".

Describe the solution you'd like

After getting this feedback I checked different select components, including chromes native select and material design select box.
Most of them seem to place the overlay below the component, a double click would simply close the overlay without changing the value.
image

Another solution would be to change the order of the items, so that the selected value is always the top one:
image
image

Describe alternatives you've considered

The current workaround as suggested by Vaadin expert chat is to create a subclass of Select and call getElement().executeJs( "this._overlayElement.setAttribute('no-vertical-overlap',true);");

Additional context

No response

@TatuLund TatuLund added the workaround There is a workaround in the comments. label Dec 5, 2022
@web-padawan web-padawan transferred this issue from vaadin/flow-components Dec 5, 2022
@web-padawan web-padawan added enhancement New feature or request vaadin-select labels Dec 5, 2022
@web-padawan
Copy link
Member

Thanks for the issue. Moved to web components as it's where it belongs. We might want to add new API for this.

@web-padawan web-padawan added the UX User experience issue label Dec 5, 2022
@web-padawan web-padawan changed the title Reconsider the position of the Select Overlay [select] Add public API to set "no-vertical-overlap" on the overlay Dec 5, 2022
@web-padawan web-padawan changed the title [select] Add public API to set "no-vertical-overlap" on the overlay [select] Add public API to set no-vertical-overlap on the overlay Dec 5, 2022
@yuriy-fix yuriy-fix added the needs design Design is needed label Dec 7, 2022
@enver-haase
Copy link
Contributor

Is it right that the getElement().executeJs( "this._overlayElement.setAttribute('no-vertical-overlap',true);"); code, called in the subclass constructor, works -- but only when you open the overlay a second or consecutive time?

@probert94
Copy link
Author

@enver-haase I am not using this workaround anymore. I now have a client-side subclass of Select which sets no-vertical-overlap to true inside ready() like this:

ready() {
  super.ready();
  this._overlayElement.setAttribute("no-vertical-overlap", true);
}

DiegoCardoso added a commit that referenced this issue Jun 18, 2024
Add a property to `vaadin-select` called `noVerticalOverlap` which
forwards its value to the same property present in the Overlay, to allow
users to configure whether they want the overlay to overlap the input
container (default) or not.

Part of #5101
DiegoCardoso added a commit that referenced this issue Jun 19, 2024
Add a property to `vaadin-select` called `noVerticalOverlap` which
forwards its value to the same property present in the Overlay, to allow
users to configure whether they want the overlay to overlap the input
container (default) or not.

Part of #5101
@sissbruecker
Copy link
Contributor

Has been resolved with vaadin/flow-components#6379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs design Design is needed UX User experience issue vaadin-select workaround There is a workaround in the comments.
Projects
None yet
Development

No branches or pull requests

6 participants