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
bug: IonPopover size "auto" does not match content #27877
Comments
Thanks for the report. Can you clarify how you are trying to set the size of the popover? By default I tried setting the following CSS in your app, and the popover was sized based on the size of its content:
|
Thanks! It does work as you say. I was doing nothing to enforce popover size based on content. Reading the documentation, I assumed auto width was the default and, therefore, I thought this was a bug. The actual behavior does make sense but the documentation is not clear. |
I agree that this is confusing. I opened a PR to clarify this: #27894 I am going to close this since this is not a bug in Ionic, but let me know if you have any questions. |
Issue number: N/A --------- <!-- 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. --> See: #27877 The current description does not accurately describe what `size="auto"` does. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Description clarifies that the width of the popover is set based on platform defaults. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
Thanks for your help! Going over the popovers in my code, I have realized |
The truncation is likely happening because of the scrollbar. I don't know if |
Yes, it looks like the scrolllbar is the cause of the truncation. It seems like |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
According to the documentation, IonPopover width will match popover content if type "auto" is selected in size attribute.
However, it forces width to 250px, the default size described in popover-md-width and does not adapt to wider content.
Expected Behavior
IonPopover width should adapt to content width when attribute size = "auto".
Steps to Reproduce
I have created a minimal app with three different pages that can be accessed using buttons in Home page. All of them include IonPopover or IonSelect with popover interface. Popover width does not match wide content in any of them.
Page1 includes a popover that can be opened using a button.
Page 2 include a form with IonSelect fields with popover interface.
Page 3 is the same as Page 2 but the form in nested inside a more complex page content, that matchs closely my real app.
Code Reproduction URL
https://github.com/Facj/ionpopover-issue
Ionic Info
$ ionic info
Ionic:
Ionic CLI : 6.6.0 (C:\Users\fcastro.NORVENTO\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/react 7.2.1
Utility:
cordova-res : not installed
native-run : 1.7.2
System:
NodeJS : v16.15.1 (C:\Program Files\nodejs\node.exe)
npm : 9.4.2
OS : Windows 10
Additional Information
There are quite a few related questions in Ionic forum (1, 2, ) and Stackoverflow (1, 2, 3 ) trying to set IonPopover size. Users are looking for CSS-based solutions, which would not be necessary if IonPopover size "auto" would actually match content width.
The text was updated successfully, but these errors were encountered: