-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection change:attribute and change:range are fired far too often #3825
Comments
What we know is that selection events are mess, so this is not a matter of specific issue, it should be re-thought as a whole. One thing is how this is solved in model. Now we know it is wrong that The other thing is how often model selection events are fired because of DOM/view. On one hand it seems wrong that I'd not only review model selection implementation but also DOM and view selection conversion/handling. What I know is that typing a letter should fire just one |
While working on https://github.com/ckeditor/ckeditor5-typing/issues/21 I made prototype of a fix. The thing that was needed was a listener for Without this I was unable to wrap all This makes handling all |
Also what do you thing about creating new, more general events to help with situation described in this issue? |
I don't think that it's a DUP. This issue is not only about resolving the way how and when selection attrs are updated, but rather about how it works inside the selection and the amount of noise that the events currently cause. E.g., as far as I understand, if you change sel attrs from "x:true,y:true" to ... "x:true,y:true", you'll get the events. Anyway, we need to debug this and plan this from two perspectives – correctness (#259) and the number of events and their usefulness (this ticket). E.g. see @maxbarnas's comment – the events now are fired too late, so you can't reason about them. |
I think it's the opposite :D. We need less noise, but more precise and useful events. So we shouldn't fire just to fire things. We should fire events to solve specific use cases. This is one of them – checking if selection attributes changed so we can reset the buffer. But at the same time, we want to filter changes done using that buffer. |
@Reinmar I agree and I corrected myself while you were writing this comment :) |
They are fired multiple times whatever you do. This makes them useless, because even if e.g. attributes don't really change, the event is fired, so https://github.com/ckeditor/ckeditor5-typing/issues/21 cannot use this event.
This issue is also related to https://github.com/ckeditor/ckeditor5-engine/issues/259.
The text was updated successfully, but these errors were encountered: