-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I make interactive applications? #54
Comments
From Blessed's FAQ, this is probably the first bit:
If you want to respond to keyboard input, I guess you'd just listen to stdin like anything else, and change your state based on that, re-rendering the UI. I don't think the components themselves need to have event handlers like the DOM stuff in ReactDOM. I could be wrong. |
to add on to this, is it possible to handle the input that happens with textboxes and elements like that? |
I haven't really been back to this since about the time I opened the issue, but to be useful for interactive apps, it seems like the elements should have Basically, I can't see how to build interactive apps without having the same primitives that browsers provide for keyboard-only interaction. If that's not an option, then some documentation explaining alternatives would go a long way toward improving the developer experience. |
as a followup to my original quesiton, i was able to use react refs to interact with the textarea i spawned and attach the necessasary listeners and handlers for text input |
Can I help somehow? |
@devsnek it's been a while but do you recall being able to go beyond submitting form text to actually capturing text "onChange" (non-existent in blessed)? I'm struggling to capture live input for a fuzzy-finder lib |
There is not |
*Edit: The ref updates immediately as seen in react-devtools (linked below), the problem is capturing that update (logging it, passing it) when it's clearly there... Thanks for the reply. Yes, that is the strategy I'm using at the moment, the problem I'm encountering is
I Type: Always one behind with a ref. @devsnek above talks about adding additional listeners to make it work, I have no experience with adding listeners or even a logical starting point to learn to do so. Any thoughts? Update: Got some help on SO which gets me unstuck. https://stackoverflow.com/questions/73134979/useref-value-in-devtools-but-not-logged#73135578 I'm still none-the-wiser |
I feel like I'm missing something, but I'm struggling to figure out how to make interactive apps with react-blessed. All of the examples appear to be purely rendering content with zero user interaction. Is there an example somewhere of an interactive app?
The text was updated successfully, but these errors were encountered: