Skip to content

Conversation

@tmcw
Copy link
Contributor

@tmcw tmcw commented Apr 10, 2019

This ports some clever logic from devtools ( https://github.com/ChromeDevTools/devtools-frontend/blob/7fbe24c094a53d6a95cbb0d19b4bf889c7dcee53/front_end/dom_extension/DOMExtension.js#L271 ) that that essentially says that if you click on something toggleable and the thing has a selection, then it won't be expanded. This works because:

  1. If you just click on it, it expands.
  2. If you select it, it doesn't expand (it has a selection)
  3. If it's selected and you click on it, the selection is zapped immediately and it expands.

@mbostock
Copy link
Member

For context, the reason we’re using mouseup instead of click is that in our inspector, the value you’re inspecting can change up to sixty times a second, and if it changes between mousedown and mouseup, a click event isn’t generated. Will the approach still work with values that change?

@tmcw
Copy link
Contributor Author

tmcw commented Apr 10, 2019

Got it - the change from mouseup to click ended up being extraneous anyway: I've switched it back. This approach (no approach) could make it easier to select quickly-changing values, but that's not a change from existing behavior.

@mbostock
Copy link
Member

Cool, glad the new technique still works! 👍

@tmcw tmcw requested a review from visnup April 10, 2019 20:26
@tmcw tmcw merged commit 87ce1e4 into master Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants