Skip to content

feat(luau): a cursor prop on ui nodes - #2127

Merged
Hona merged 1 commit into
devfrom
cursor/luau-cursor
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
cursor/luau-cursor

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Compiled

Compiled on Windows x64, Windows arm64, macOS and Linux x64 in anomalyco/opencode-rune#1137, all four build jobs green: the app with Rune pinned to a check commit, the rev the app pins today (4d8df909) plus this change and the five other cursor changes, cherry-picked. That is this change on the app's rev, not on this branch's base (dev is 117 commits past it); every match on Cursor that dev has was checked by reading.

Why

A script could not set the pointer's shape. Everything a Luau view drew showed the arrow (a text field, the I-beam), whatever the design it follows shows there: a field-like button that should read as text, a disabled control, a handle.

What changes

A cursor prop on ui.* nodes, by CSS name:

ui.row({ key = "address", cursor = "text", onPress = focus }, { url })

default, pointer, text, grab, grabbing, not-allowed, move, col-resize, row-resize, ew-resize, ns-resize, nwse-resize, nesw-resize, crosshair, cell, zoom-in, zoom-out.

It is El::cursor: the shape shows over the node and over what is inside it that sets none, while the pointer is over a hit target there (a pressable, hoverable or text node). An unknown name is a render error, as an unknown dir is.

What it can change for an app

Nothing for a script that does not use it. A host that checks a script's props against its own list of names sees a new name from rune_luau::prop_names().

Not run

The new test has not been run: this repo's tests run on the scheduled macOS job, which I read after the merge. cursor_names_the_pointers_shape_over_a_node_and_rejects_an_unknown_name covers a node with a cursor, one without, and an unknown name.

CSS cursor by name, applied with El::cursor. A script could not set the pointer's shape over what it draws.
@Hona
Hona marked this pull request as ready for review November 25, 2026 05:59
@Hona
Hona merged commit 368d3a5 into dev Nov 25, 2026
1 check passed
@Hona
Hona deleted the cursor/luau-cursor branch November 25, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant