NO BUG: Dropdown content position causes scrollbar

Browser: Chrome 125
OS: Windows
URL: dropdown – Try Bricks – t7b3ff1b

Hi bricks team,

If we have the following two items in the drop-down element, horizontal scrolling will appear in the browser on the front end when the page is loaded.

1- In control Min. width Set the desired width.
2- Place the dropdown on the right side of the container (flex end).

To better understand this bug, please watch the video below.

Hi Hosein,
Depending on the available space, the dropdown content either opens to the right (if there is enough space) or to the left (if there is not enough space).

It does this by using JS to calculate whether there is enough space when the page is loaded. If there is not enough space, we add a class to change the position of the dropdown content. This normally takes about a millisecond and results in the scrollbar you show in your video when loading.

However, you can avoid this problem by setting the “right” value of the dropdown content to 0. Then, regardless of the calculation, it will always align itself directly to the right edge.

Thanks for the great solution @timmse,

cheers