Turn off width for Select2 #3103

Closed
opened 2025-12-29 18:25:40 +01:00 by adam · 1 comment
Owner

Originally created by @hSaria on GitHub (Jan 1, 2020).

Proposed Changes

Set width: "off" for the Select2 plugin. The bootstrap theme is handling the width.

Justification

Select2 is resolving the width and statically setting it for the container. I've seen one instance (Service) where it fails to calculate it correctly.
image
image

Turning off width handling addresses this issue, and it provides us with flexibility on how to display the element (not that there's need to modify it any the moment).
image
image

Originally created by @hSaria on GitHub (Jan 1, 2020). ### Proposed Changes Set `width: "off"` for the Select2 plugin. The bootstrap theme is handling the width. ### Justification Select2 is resolving the width and statically setting it for the container. I've seen one instance (Service) where it fails to calculate it correctly. ![image](https://user-images.githubusercontent.com/34197532/71646008-868a7380-2cd8-11ea-9d42-d84924bfd36c.png) ![image](https://user-images.githubusercontent.com/34197532/71663395-f4708280-2d4c-11ea-9f94-d51c57ee1079.png) Turning off width handling addresses this issue, and it provides us with flexibility on how to display the element (not that there's need to modify it any the moment). ![image](https://user-images.githubusercontent.com/34197532/71646055-2811c500-2cd9-11ea-91dc-e87f1c1eea2a.png) ![image](https://user-images.githubusercontent.com/34197532/71663413-09e5ac80-2d4d-11ea-81fb-c2c0bd24a61b.png)
adam added the status: accepted label 2025-12-29 18:25:40 +01:00
adam closed this issue 2025-12-29 18:25:40 +01:00
Author
Owner

@hSaria commented on GitHub (Jan 2, 2020):

In addition, this fixes the width when changing the window size

Before

Load size:
image
Window size changes:
image

After

Load size:
image
Window size changes (width still fills the column):
image

@hSaria commented on GitHub (Jan 2, 2020): In addition, this fixes the width when changing the window size #### Before Load size: ![image](https://user-images.githubusercontent.com/34197532/71663595-c2abeb80-2d4d-11ea-8fef-6f8703e6c8ab.png) Window size changes: ![image](https://user-images.githubusercontent.com/34197532/71663601-c7709f80-2d4d-11ea-9049-5660b84adc76.png) #### After Load size: ![image](https://user-images.githubusercontent.com/34197532/71663609-cfc8da80-2d4d-11ea-8b7d-23f41500dee2.png) Window size changes (width still fills the column): ![image](https://user-images.githubusercontent.com/34197532/71663616-d8211580-2d4d-11ea-948c-dd50e76e1075.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3103