Ckeditor5: Event stop and return

Created on 19 Jan 2018  路  5Comments  路  Source: ckeditor/ckeditor5

It's is a very common case that one wants to stop the event and set the return value:

evt.stop();
evt.return = 'foo';

I think that is should be possible to do it in a single line. We should keep the possibility to set the return value without stopping event, so not to make it confusing I would do:

evt.stop( 'foo' );
utils wontfix discussion improvement

Most helpful comment

IMO, evt.stop( value ) will not read well. Do you stop the value? What does "stop event with value" mean?

I know about ckeditor/ckeditor5-engine#1234 and @scofalik's idea to have helpers totally resolves that case. After we implement them (I plan this still in it14) we won't have many evt.stop+evt.return in our code.

All 5 comments

IMO, evt.stop( value ) will not read well. Do you stop the value? What does "stop event with value" mean?

I know about ckeditor/ckeditor5-engine#1234 and @scofalik's idea to have helpers totally resolves that case. After we implement them (I plan this still in it14) we won't have many evt.stop+evt.return in our code.

Or maybe I'm overexaggerating... I don't know. I don't have a strong opinion on that.

Yea, I'm also not sure about it. And it's not that common case in fact. Let's keep it open for the future cases.

It's been over 1.5 year since the ticket was open and we don't see a strong need to implement this API.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Reinmar picture Reinmar  路  3Comments

pjasiun picture pjasiun  路  3Comments

MansoorJafari picture MansoorJafari  路  3Comments

benjismith picture benjismith  路  3Comments

oleq picture oleq  路  3Comments