Feature Request: Allow ng-dropdown panel option to grow larger than parent
See original GitHub issueExpected behaviour
Allow the dropdown panel width for the options to grow larger than the parent for long items
Actual behaviour
Dropdown panel width limited to the size of the parent
More Info
ng-select version:1.0.3
I can allow this by changing the ng-dropdown-panel.component line 363:
//from: dropdownPanel.style.width = selectRect.width + 'px';
dropdownPanel.style.width = 'auto';
dropdownPanel.style.minWidth = selectRect.width + 'px';
perhaps it makes sense to make this an option.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
ng-dropdown-panel in ng-select - how to keep its custom ...
But when I am rendering <ng-select> with appendTo="body" then the ng-dropdown-panel is no more taking the custom styles and the reason is as ......
Read more >ngSelect Customizations: Draggable Panel
Today I'm writing about how I made the ng-select dropdown resize by dragging the dropdown box wider. If you want to follow along...
Read more >TikTok app safety - What parents need to know
What do parents say about the app? What should parents be concerned about? Does TikTok have any e-safety features?
Read more >overflow-x - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, ...
Read more >ng-multiselect-dropdown
dropdown with single/multiple selction option · bind to any custom data source · search item with custom placeholder text · limit selection ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works fine when virtual scroll is false, but when setting
[virtualScroll]="true"
then width: auto doesn’t work.Yes - CSS only would be the ideal solution, however, you can’t just use CSS because the minimum size is calculated in the code. So while I can over-ride and set the width to auto, CSS can not know the minimum size to set.
So what happens is if an ng-select has text that is smaller than the parent the panel becomes smaller than the parent which looks terrible.
So I realized there is an easy way to make it allow in CSS with 1 minor code change:
Then the behavior is as always to most users, but if you want the panel to grow larger than the parent in css set the panel width to ‘auto’. If you could make that small change that would be very helpful.
Thanks.