Skip to content

Commit

Permalink
fix(select): popover can be scrolled (#28965)
Browse files Browse the repository at this point in the history
Issue number: resolves #28963

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

In #28861 I fixed an
issue that caused the wrong content inside of a popover to be
scrollable. This CSS should have been applied, but it broke back when
popover was converted to the Shadow DOM. Fixing this issue revealed a
misconfiguration with the select-popover that caused the select-popover
to no longer be scrollable.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Content inside of `ion-select-popover` can now be scrolled

Note that I am considering this a bug fix instead of a regression. While
scrolling used to work in select-popover, it only worked by chance. The
`.popover-viewport` styles should have always applied to the
select-popover, thus requiring the use of `overflow-y: auto` in
select-popover.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.7.1-dev.11706893059.1bef4b38`
  • Loading branch information
liamdebeasi committed Feb 5, 2024
1 parent 51c729e commit 35ab6b4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/components/select-popover/select-popover.scss
Expand Up @@ -8,3 +8,14 @@ ion-list-header,
ion-label {
@include margin(0);
}


/**
* The main content inside of a popover has overflow: hidden
* so that a descendant ion-content can be scrolled.
* However, select-popover does not use ion-content so we need
* to explicitly make this container scrollable.
*/
:host {
overflow-y: auto;
}

0 comments on commit 35ab6b4

Please sign in to comment.