Skip to content
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

Event props do not work on ui.text_field, circular structure error logged to browser console #893

Open
mofojed opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working deephaven.ui triage

Comments

@mofojed
Copy link
Member

mofojed commented Sep 18, 2024

Description

The props for events on ui.text_field are not wired up correctly and do not work, logging an error in the browser console.

Steps to reproduce

  1. Create a ui.textfield with on_focus and on_blur events: tf = ui.text_field(label="Focus me", on_focus=lambda: print("Focus!"), on_blur=lambda: print("Blur!"))
  2. Click in and out of the text field that's shown

Expected results
2. "Focus!" and "Blur!" should be printed in the python console

Actual results
2. Nothing is printed to the Python console. An error is logged in the browser logs:

Uncaught (in promise) Error: Converting circular structure to JSON
    --> starting at object with constructor 'HTMLInputElement'
    |     property '__reactFiber$a5vcbx0bdh' -> object with constructor 'nXe'
    --- property 'stateNode' closes the circle
    at new JSONRPCErrorException2 (eval at <anonymous> (vendor-808b021e.js:1:1), <anonymous>:6719:28)
    at JSONRPCClient2.eval (eval at <anonymous> (vendor-808b021e.js:1:1), <anonymous>:6961:43)
    at step (eval at <anonymous> (vendor-808b021e.js:1:1), <anonymous>:6868:19)
    at Object.eval [as next] (eval at <anonymous> (vendor-808b021e.js:1:1), <anonymous>:6815:14)
    at fulfilled (eval at <anonymous> (vendor-808b021e.js:1:1), <anonymous>:6786:24)

Versions

Engine Version: 0.36.1
Web UI Version: 0.90.0
Java Version: 11.0.24
Barrage Version: 0.6.0
Browser Name: Chrome 128
OS Name: Linux
@deephaven/js-plugin-ui: 0.21.0

@mofojed
Copy link
Member Author

mofojed commented Sep 18, 2024

Need to correctly deserialize the events like we already do for Button/Toggle button. We won't be able to just use useButtonProps though, but perhaps you can break useButtonProps down into a couple of hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deephaven.ui triage
Projects
None yet
Development

No branches or pull requests

2 participants