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(select): prevent clicks on non-interactive elements inside ion-select to ensure correct popover size #697

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

felipefialho
Copy link
Contributor

What is being delivered?

In some cases, when a user clicks on an individual element inside an ion-select, the size of the ion-popover changes unexpectedly. For example, clicking on the arrow icon of the ion-select can cause the options overlay to become very small, leading to a poor user experience.

To prevent these extra clicks and ensure a consistent overlay size, the proposed solution is to add pointer-events: none to elements inside the ion-select that are not the label or icon.

Since ion-select is a web component, we must access its shadow DOM to apply this style.

What impacts?

  • Users will be unable to click on individual elements inside the ion-select that are not the label or icon. This ensures that the popover opens with the correct size and prevents unexpected behavior, leading to a more consistent and improved user experience.

Reversal plan

  • Remove the pointer-events: none from the elements inside the ion-select.

@felipefialho felipefialho added bug Something isn't working package/core labels Feb 4, 2025
@felipefialho felipefialho self-assigned this Feb 4, 2025
Copy link

sonarqubecloud bot commented Feb 4, 2025

Copy link
Contributor

github-actions bot commented Feb 4, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-02-04 22:11 UTC

@felipefialho felipefialho merged commit 02200ec into main Feb 4, 2025
5 checks passed
@felipefialho felipefialho deleted the fix/avoid-error-to-open-popover-on-select branch February 4, 2025 22:08
@github-actions github-actions bot mentioned this pull request Jan 31, 2025
ionSelect?.shadowRoot?.querySelector('.select-wrapper')

if (selectWrapper) {
(selectWrapper as HTMLElement).style.pointerEvents = 'none'
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package/core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants