Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Disble selection#3

Merged
frankiefu merged 1 commit into
googlearchive:masterfrom
warnerandy:disble-selection
Jul 9, 2014
Merged

Disble selection#3
frankiefu merged 1 commit into
googlearchive:masterfrom
warnerandy:disble-selection

Conversation

@warnerandy

Copy link
Copy Markdown
Contributor

Having text become selected while moving the splitter is unwanted behavior. So lets disable text selection while the splitter is moving.

Comment thread core-splitter.html Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We prefer camel case, e.g. disableSelection

@warnerandy

Copy link
Copy Markdown
Contributor Author

cool, i'll make the changes

@warnerandy

Copy link
Copy Markdown
Contributor Author

@frankiefu i've made your changes let me know if there is anything else i need to do

Comment thread core-splitter.html Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

disableselection -> disableSelection

remove unneccessary css class

setting the userSelect prop on the parent node not the body
@warnerandy

Copy link
Copy Markdown
Contributor Author

@frankiefu fixed the tabbing and the missed camelCasing

@frankiefu

Copy link
Copy Markdown
Contributor

lgtm

frankiefu added a commit that referenced this pull request Jul 9, 2014
@frankiefu frankiefu merged commit 8327b07 into googlearchive:master Jul 9, 2014
@arv

arv commented Jul 9, 2014

Copy link
Copy Markdown

FWIW, you can achieve the same with preventDefault. See https://chromium.googlesource.com/chromium/src/+/master/ui/webui/resources/js/cr/ui/splitter.js#138

@sjmiles

sjmiles commented Jul 9, 2014

Copy link
Copy Markdown

Sounds like this control should be built into the tracking gesture.

@arv

arv commented Jul 9, 2014

Copy link
Copy Markdown

@azakus The preventDefault needs to be done in mousedown. Calling preventDefault in trackstart did not work. I'll have to look into how trackstart is implemented.

@arv

arv commented Jul 9, 2014

Copy link
Copy Markdown

FWIW, #4

@dfreedm

dfreedm commented Jul 9, 2014

Copy link
Copy Markdown
Contributor

@arv I imagine that trackstart is probably too late, as it is sent asynchronously, and only after a hysteresis threshold.

@frankiefu

Copy link
Copy Markdown
Contributor

down doesn't work too. e.g.

on-down="{{preventSelection}}"
...
preventSelection: function(e) {
  e.preventDefault();
}

@arv

arv commented Jul 10, 2014

Copy link
Copy Markdown

@frankiefu You need to use on-mousedown. See #4. I manually tested it.

@arv

arv commented Jul 10, 2014

Copy link
Copy Markdown

@azakus Maybe we should move this into PointerGestures repo. preventDefault in down should work, shouldn't it?

@frankiefu

Copy link
Copy Markdown
Contributor

Thanks @arv for the insight. Also polymer now uses polymer-gestures instead of PointerGestures. I have filed couple issues on polymer-gestures regarding preventDefault in down doesn't work and have disable selection built into tracking gesture:
googlearchive/polymer-gestures#20
googlearchive/polymer-gestures#21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants