Skip to content

Commit

Permalink
Fix being unable to scroll up when there's a lot of datastores in the…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
pinehappi committed Nov 16, 2024
1 parent 6bc08cf commit fee3bd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/UI/StyleState/TabsStyleState.luau
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ function TabsStyleState.from(theme, frame: Frame)
return self
end

function TabsStyleState:isSelecting(name: string?): boolean
if self.selecting == nil or name == nil then
return self.selecting == name
else
return self.selecting:lower() == name:lower()
end
end

function TabsStyleState:select(name: string)
if self.selecting == name then
return
Expand Down
6 changes: 3 additions & 3 deletions src/UI/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ function UI:autoFocus()
task.delay(0, function()
if self.parent and self.parent.Enabled then
if self.activeView == "game" then
if self.styleStates.connect.tabs.selecting:lower() == "connect" then
if self.styleStates.connect.tabs:isSelecting("connect") then
self.styleStates.connect.dataStoreNameTextBox.textBox:CaptureFocus()
elseif self.styleStates.connect.tabs.selecting:lower() == "list" then
elseif self.styleStates.connect.tabs:isSelecting("list") then
self.styleStates.connect.prefix.textBox:CaptureFocus()
end
elseif self.activeView == "datastore" then
Expand Down Expand Up @@ -405,7 +405,7 @@ function UI:_updateConnectCentering()
if
self.gui.ConnectDataStore.Content.DataStoreList.Visible
and self.gui.ConnectDataStore.Content.DataStoreList.Table.Visible
and self.styleStates.connect.tabs.selecting == "list"
and self.styleStates.connect.tabs:isSelecting("list")
then
self.gui.ConnectDataStore.Content.UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
self.gui.ConnectDataStore.Content.UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Top
Expand Down

0 comments on commit fee3bd2

Please sign in to comment.