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

[Table] EditableCell + setState = value doesn't change #1234

Closed
seansfkelley opened this issue Jun 14, 2017 · 0 comments
Closed

[Table] EditableCell + setState = value doesn't change #1234

seansfkelley opened this issue Jun 14, 2017 · 0 comments

Comments

@seansfkelley
Copy link

seansfkelley commented Jun 14, 2017

Bug report

  • Package version(s): whatever is on the docs at the time of filing (Core v1.20.0, Table v1.17.0)
  • Browser and OS versions: Chrome 58.0.3029.110, OS X 10.12.5

Steps to reproduce

  1. Go to the "Editable content" docs: http://blueprintjs.com/docs/#table-js.editable-content and open React dev tools
  2. Find the TableEditableExample component and select it such that it's assigned to $r in the console
  3. run $r.setState({ sparseCellData: Object.assign({}, $r.state.sparseCellData, { '1-1': 'foo' }) }) in the console

Actual behavior

  1. Nothing changes.

Expected behavior

  1. The value of the cell currently set to "editable" should change to "foo". Note that the dev tools reflect the correct state and the implementation of the example isn't doing anything particularly weird (https://github.com/palantir/blueprint/blob/master/packages/table/examples/tableEditableExample.tsx).

This is a stripped-down version of the issue I originally saw, but note that in my actual code, I use the intent field for validation as well, which is calculated at render time (as opposed to cached in state like the example), and changing the value using setState does cause the intent to change in the DOM, but not the text content (as here).

In my use-case, the table is editable and part of a controlled component, so every time you change something it makes the callback -> props roundtrip, which means I hit this issue all of the time. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants