You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you have multiple dropdowns in a frame, they are prioritized in the order they were added (last in the top).
This means that if you are adding a bunch of dropdowns in a column (perhaps using a for loop), the dropdown box of the ones above will be overshadowed by the label of the ones below.
Minimal Working Example
-- Basalt configurated installerlocalfilePath="/basalt.lua" --here you can change the file path default: basaltifnot(fs.exists(filePath))thenshell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", "")) -- this is an alternative to the wget commandendlocalbasalt=require(filePath:gsub(".lua", ""))
localmain=basalt.createFrame("mainFrame")
fori=1, 3dolocalfg_color, bg_colorifi%2==0thenfg_color=colors.blackbg_color=colors.whiteelsefg_color=colors.whitebg_color=colors.blackendmain:addDropdown('dropdown_'..i)
:setPosition(20, 6+ (2*i))
:setSize(10, 1)
:addItem('Option 1')
:addItem('Option 2')
:addItem('Option 3')
:addItem('Option 4')
:addItem('Option 5')
:setForeground(fg_color)
:setBackground(bg_color)
:selectItem(1)
endbasalt.autoUpdate()
output.mp4
Desired Solution
For me, a reasonable solution would be to prioritize rendering the dropdown box over the dropdown label whenever they are in the same index.
Alternative Solutions
From basalt's part:
Reverse the priority order (i.e. make later added items less prioritized).
I wouldn't like this solution, as I would expect items added later to be rendered above items added beforehand, including dropdowns.
Prioritize rendering active dropdowns.
I wouldn't like this solution, as I wouldn't expect a dropdown to be "brought to the front" just because it was clicked. For example, in the setup below, the dropdown stays behind after being clicked. That's the behaviour I would expect, and the dropdown getting "popped" up would be weird in that scenario.
output.mp4
From my part:
Reversing the for loop. (i.e. for i = 3, 1, -1 do)
Manually setting the index. (i.e. :setZIndex(3 - i))
Both of these workarounds resolve the issue.
output.mp4
Additional context
Although the workarounds (from my part) are quite simple, I think it's reasonable for a developer using the API to assume the dropdowns boxes (on the same level) would be prioritized over labels.
As an example, in the Windows API for GUI, it's true (and expected) that if you add a couple of dropdowns in a column one after another, when you click on the first dropdown, its box won't be overshadowed by the dropdowns below it. I think it's reasonable to assume the same behaviour in basalt.
Edit: I now realize this is probably a bug report, not a feature request... oh well ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered:
Hello, thank you - this is a very good idea and i will try to implement it! But i will need a couple of days, especially because currently is a interesting beta to test! :P
Problem
Currently, if you have multiple dropdowns in a frame, they are prioritized in the order they were added (last in the top).
This means that if you are adding a bunch of dropdowns in a column (perhaps using a
for
loop), the dropdown box of the ones above will be overshadowed by the label of the ones below.Minimal Working Example
output.mp4
Desired Solution
For me, a reasonable solution would be to prioritize rendering the dropdown box over the dropdown label whenever they are in the same index.
Alternative Solutions
From basalt's part:
output.mp4
From my part:
for
loop. (i.e.for i = 3, 1, -1 do
):setZIndex(3 - i)
)Both of these workarounds resolve the issue.
output.mp4
Additional context
Although the workarounds (from my part) are quite simple, I think it's reasonable for a developer using the API to assume the dropdowns boxes (on the same level) would be prioritized over labels.
As an example, in the Windows API for GUI, it's true (and expected) that if you add a couple of dropdowns in a column one after another, when you click on the first dropdown, its box won't be overshadowed by the dropdowns below it. I think it's reasonable to assume the same behaviour in basalt.
Edit: I now realize this is probably a bug report, not a feature request... oh well ¯\_(ツ)_/¯
The text was updated successfully, but these errors were encountered: