Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

3.0 click behavior #79

Merged
merged 10 commits into from
Sep 12, 2018
Merged

3.0 click behavior #79

merged 10 commits into from
Sep 12, 2018

Conversation

Marc-Andre-Rivet
Copy link
Contributor

This brings the overall behavior closer to Excel's and reduces expectation gap for the end-user.
-> single click: focuses on the input and selects all content
-> click a second time to insert at a specific position

Marc-André Rivet added 2 commits September 12, 2018 07:30

if (active && this.refs.textInput) {
(this.refs.textInput as HTMLElement).focus();
if (active && document.activeElement !== input) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only force selection when the cell/input is first selected by the user

@@ -1,6 +1,6 @@
{
"name": "dash-table",
"version": "3.0.0rc12",
"version": "3.0.0rc13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump version

Copy link
Contributor

@wbrgss wbrgss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implements @Marc-Andre-Rivet's expected behaviour well.

However, I still think a dblclick event should still be handled the same as the "click, click again" behaviour mentioned above, in order to fully resolve #77 (thoughts @cldougl ?). It might be tricky as a dblclick will trigger two click events and one dblclick, for three events total.

best I've got so far

suggests this is a WIP. So approval from me pending my (nit) comment below about the CHANGELOG.

CHANGELOG.md Outdated
@@ -100,3 +100,7 @@
Issue: https://github.com/plotly/dash-table/issues/68
Issue: https://github.com/plotly/dash-table/issues/73
Issue: https://github.com/plotly/dash-table/issues/76

## RC13 - Modify click & dblclick behavior
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's misleading to state that dblclick event handling has been modified in this PR, as dblclick is a technical term for the event and its behaviour remains the same. I would prefer "double click", "x2 click", "sequential click" etc. just to be crystal clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the changelog. You are right, this is not a definitive answer, just the simplest implementation that goes one step towards the desired one.

@Marc-Andre-Rivet
Copy link
Contributor Author

@wbrgss Update changelog.md as per your comments, let me know if good enough

@cldougl
Copy link
Member

cldougl commented Sep 12, 2018

agreed on:

I still think a dblclick event should still be handled the same as the "click, click again" behaviour mentioned above

as this is a semi-WIP I think this is great so far as it brings the behaviour closer to what excel users will expect. We should still be open about further developing the click/dblclick events as more people continue to use the table

@cldougl
Copy link
Member

cldougl commented Sep 12, 2018

lgtm 💃

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit 7bf8658 into master Sep 12, 2018
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 3.0-click-behavior branch October 12, 2018 13:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants