w3c / selection-api

Selection API
http://w3c.github.io/selection-api/
Other
47 stars 30 forks source link

Add API to make selection visible #73

Open gked opened 8 years ago

gked commented 8 years ago

Moving issue from editing issue tracker as this is selection related.

Originally, was opened by yosinch

I would like to propose new selection API, Selection#makeVisible() which makes caret(extentNode, extenOffset) visible in viewport. Background: It is hard to make caret visible, if it is in a element with "overflow: scroll" CSS property. Or, there is no way for TEXTAREA. Inspired by http://crbug.com/612729

Yaffle commented 8 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=612729 https://bugs.chromium.org/p/chromium/issues/detail?id=331233 - related?

Why new API? from the ticket it is not clear why not to scroll when selectionStart/selectionEnd/setSelectionRange() where used... (Firefox and Opera (Presto) do this)