React-data-grid: Add flag to show editor on single click.

Created on 25 Apr 2019  路  7Comments  路  Source: adazzle/react-data-grid

  • [ ] 馃悰 Bug Report
  • [x] 馃挕 Feature Request

If column is editable editor appears when user click on cell 3 times (once for cell selection and twice to show editor). There should be some setting that change this behavior. On my private fork I pass true to selectCell function call in onCellClick method in ReactDataGrid component. For now it seems to work fine.

Most helpful comment

By the way, today users told me that single-click should show editor only if a cell is already selected, otherwise it should select it.

I agree to this, otherwise, clicking would cause unwanted edited triggers and bad UX. but there are some columns that needs editor with single click, for example a checkbox or a dropdown.

consider this scenario,
i want to select some value from a dropdown.
I click once to select the cell => click again to show editor => then click again to open the select box(although this could be done by open on load or something) => and then the fourth time we gotta click to actually select something.

This seems a real painful job for the end user. I think there can be a props to enable disable 'single click editor mode', that way its a win-win for everyone. I'm happy to give a PR for this if someone could guide me where to start/look for.

All 7 comments

would be awesome if we could get this feature. At my work, we have a column with a single checkbox(to represent say expired/active) which should be selectable via some key when the cell is highlighted as well as clickable with one mouse click.

@Ragzzy-R there is a workaround you can use to achieve the behavior you want.
You can use custom formatter to display a column with checkboxes, formatters get context row as a parameter so you can find and modify a row in your state on change.

hello, sorry for late reply. I haven't tried this but won't changing the grid's state cause the entire grid to re-render? will that affect performance?

I haven't check it. I've revied code and as long as the size of your array is the same it shouldn't do intensive DOM changes. You should be also careful about object creation.

By the way, today users told me that single-click should show editor only if a cell is already selected, otherwise it should select it.

By the way, today users told me that single-click should show editor only if a cell is already selected, otherwise it should select it.

I agree to this, otherwise, clicking would cause unwanted edited triggers and bad UX. but there are some columns that needs editor with single click, for example a checkbox or a dropdown.

consider this scenario,
i want to select some value from a dropdown.
I click once to select the cell => click again to show editor => then click again to open the select box(although this could be done by open on load or something) => and then the fourth time we gotta click to actually select something.

This seems a real painful job for the end user. I think there can be a props to enable disable 'single click editor mode', that way its a win-win for everyone. I'm happy to give a PR for this if someone could guide me where to start/look for.

any updates on this one ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlarso11 picture jlarso11  路  3Comments

daniel1943 picture daniel1943  路  3Comments

GenoD picture GenoD  路  3Comments

JimLynchCodes picture JimLynchCodes  路  4Comments

alvaro1728 picture alvaro1728  路  4Comments