@rbxts/uiblox 0.2.0-alpha.27 → 0.2.0-alpha.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,6 +72,7 @@ local function SxHost(props)
72
72
  local paint = paintHostStyle(theme, _exp, _exp_1, sx, width, _object)
73
73
  local rest = hostRest(props)
74
74
  local caller = rest.Event
75
+ local pressable = tag == "textbutton" or tag == "imagebutton"
75
76
  local _object_1 = {}
76
77
  if caller then
77
78
  for _k, _v in caller do
@@ -103,30 +104,6 @@ local function SxHost(props)
103
104
  end
104
105
  end
105
106
  end
106
- _object_1.MouseButton1Down = function(...)
107
- local args = { ... }
108
- if not locked then
109
- setPressed(true)
110
- end
111
- local _result_1 = caller
112
- if _result_1 ~= nil then
113
- _result_1 = _result_1.MouseButton1Down
114
- if _result_1 ~= nil then
115
- _result_1(unpack(args))
116
- end
117
- end
118
- end
119
- _object_1.MouseButton1Up = function(...)
120
- local args = { ... }
121
- setPressed(false)
122
- local _result_1 = caller
123
- if _result_1 ~= nil then
124
- _result_1 = _result_1.MouseButton1Up
125
- if _result_1 ~= nil then
126
- _result_1(unpack(args))
127
- end
128
- end
129
- end
130
107
  _object_1.SelectionGained = function(...)
131
108
  local args = { ... }
132
109
  if not locked then
@@ -152,6 +129,34 @@ local function SxHost(props)
152
129
  end
153
130
  end
154
131
  rest.Event = _object_1
132
+ -- GuiButton-only; Frames reject MouseButton1* and crash Select/Menu hosts.
133
+ if pressable then
134
+ local events = rest.Event
135
+ events.MouseButton1Down = function(...)
136
+ local args = { ... }
137
+ if not locked then
138
+ setPressed(true)
139
+ end
140
+ local _result_1 = caller
141
+ if _result_1 ~= nil then
142
+ _result_1 = _result_1.MouseButton1Down
143
+ if _result_1 ~= nil then
144
+ _result_1(unpack(args))
145
+ end
146
+ end
147
+ end
148
+ events.MouseButton1Up = function(...)
149
+ local args = { ... }
150
+ setPressed(false)
151
+ local _result_1 = caller
152
+ if _result_1 ~= nil then
153
+ _result_1 = _result_1.MouseButton1Up
154
+ if _result_1 ~= nil then
155
+ _result_1(unpack(args))
156
+ end
157
+ end
158
+ end
159
+ end
155
160
  local nodes = React.Children.toArray(props.children)
156
161
  local painted = {}
157
162
  local hasPad = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.2.0-alpha.27",
3
+ "version": "0.2.0-alpha.28",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",