Pyroxenium / Basalt

A UI Framework for CC:Tweaked
MIT License
164 stars 28 forks source link

bug: scrolling `Frame` does not account for extended `Dropdown` #36

Closed luiz00martins closed 1 year ago

luiz00martins commented 1 year ago

Note: I'm not sure if this is a bug report or a feature request (i.e. if this is unintended or intended behaviour).


Describe the bug

An expanded Dropdown may have items inaccessible, as Frame scrolling is disabled while the dropdown is expanded.

Minimal Working Example

https://user-images.githubusercontent.com/43142209/197318853-3dfcea13-7f3d-40c5-ac11-a71f875ed1ba.mp4

local filePath = "/basalt.lua"
if not(fs.exists(filePath))then
    shell.run("pastebin run ESs1mg7P packed true "..filePath:gsub(".lua", ""))
end
local basalt = require(filePath:gsub(".lua", ""))

local main = basalt.createFrame("mainFrame"):setScrollable()

local w, h = term.getSize()

for i=1,5 do
    main:addDropdown('dropdown_'..tostring(i))
        :setPosition(2, h+i-2)
        :setSize(10, 1)
        :addItem('Item 1')
        :addItem('Item 2')
        :addItem('Item 3')
        :show()
end

basalt.autoUpdate()

In the example above, Item 2 and Item 3 are inaccessible, as:

  1. They are not visible even in that maximum scroll down of the Frame
  2. Further scrolling is disabled while the Dropdown is expanded

Expected behavior

Be able to scroll further down the Frame while the Dropdown is expanded.

Checklist

[x] I am running the latest version.

NoryiE commented 1 year ago

Hello, i guess this is the fix you want: b303b46 currently only on the dev branch available