Skip to content

Conversation

@Exanite
Copy link
Contributor

@Exanite Exanite commented Nov 3, 2025

This ensures that the value used is the value provided, which allows for better control.
The original behavior just caches the value internally, which makes it hard to change the text value from code unless doing something hacky like changing the ID.

This also means that in order to have text inputs work, the developer needs to implement the callback, but this is reasonable and provides better control:

// From PaperDemo

// No callback
// This prevents the user from changing the text field
Input.Secondary("SearchTextField", searchText)

// Also prevents user from changing the text field
Input.Secondary("SearchTextField", searchText, newValue => {}, "Search...")

This is a change that I made a while ago in my fork, but didn't make a PR for since it's somewhat of a hacky solution.

I'm opening this now since Zed had the same issue as me in the Discord. I plan to improve on this a bit more in the future (look into alternative way of setting the text value; maybe make the callback required done).

This ensures that the value used is the value provided, which allows for better control.

(cherry picked from commit 5691fa4)
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