-
Notifications
You must be signed in to change notification settings - Fork 6
T/40: Implement the selection handler #43
Conversation
This PR may need some additional work: ckeditor/ckeditor5#974 (comment). It might be that |
We need more spacing around the widget (see https://ckeditor.com/ckeditor-4/) because it's hard to use the handler |
I just found out that we were able to implement it like this in v4 because TBH I don't like the UX proposed in this PR but OTOH I'm not sure we can affort another wrapper. WDYT @jodator @Reinmar @dkonopka? |
Reversing color is a good idea 👍 Would be nice if we could show an active/inactive state of widget selection not only via outline color change (because first time user doesn't see a difference between yellow/blue) but in icon animation (or completely change it in this case). WDYT? Fast proposal (scale svg: 0.85 if active)The other thing is the size of this selection handler - are you comfortable to catch it? How about making invisible right 10px padding or enlarge width of this button? |
…standards. Moved widget selection handler styles to ckeditor5-theme-lark. Implemented a 2-state handler icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor naming issue
src/utils.js
Outdated
@@ -61,6 +66,10 @@ export function toWidget( element, writer, options = {} ) { | |||
setLabel( element, options.label, writer ); | |||
} | |||
|
|||
if ( options.addSelectionHandler ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasSelectionHandler
, I'd say.
Just for the record:
|
src/utils.js
Outdated
@@ -184,7 +184,7 @@ function getFillerOffset() { | |||
// | |||
// @param {module:engine/view/editableelement~EditableElement} | |||
// @param {module:engine/view/writer~Writer} writer | |||
function addSelectionHandler( editable, writer ) { | |||
function hasSelectionHandler( editable, writer ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this stay as addSelectionHandler()
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Search/replace. Fixing :/
…ddSelectionHandler.
Suggested merge commit message (convention)
Feature: Implement the selection handler. Closes ckeditor/ckeditor5#4586.
Additional information