-
Notifications
You must be signed in to change notification settings - Fork 18
i/6087: Created the "Deep dive into focus tracking" guide. #552
Conversation
|
||
The main editable area of CKEditor can be focused thanks to the [`contenteditable`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content) DOM attribute. This attribute tells the web browser that a web page element can be edited like any other text field, which also means it must be able to receive focus. | ||
|
||
Each root of the editing view has the `contenteditable` attribute. The editing view uses the {@link module:utils/focustracker~FocusTracker `FocusTracker`} (learn more about {@link framework/guides/architecture/editing-engine#observers view observers}) to track focus in editables by listening to native DOM `focus` and `blur` events coming from them. |
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.
Wasn't this supposed to be about FocusObserver
?
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.
No, why do you think it should?
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.
Because you link to view observers, so the thing you're talking about is FocusObserver, not FocusTracker. The engine view definitely uses focus observer.
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.
You're right, my bad.
The guide is fantastic. I think it's by far the best one we have :) I think there's only one thing that I miss – a clear explanation that there's this main editor focus tracker and that all focusable roots are registered here and a list of these (toolbar, editables, etc). And then a word that we consider the editor having focus as long as any of these items have focus. Theoretically most of these is explained in |
Haha :D I've had one last "Conclusions" part to read before I wrote the above comment and I can see that it seems to clarify some of those things. Still, I'd have it somewhere earlier too. |
Co-Authored-By: Piotrek Koszuliński <pkoszulinski@gmail.com>
…right way to change the selection.
TBH, I couldn't find any good place to explain it earlier. Do you have any idea where could it be? |
I think you could just add this additional info as another points in the list I mentioned in #552 (comment). |
Done. They only unresolved discussion is #552 (comment). |
Suggested merge commit message (convention)
Docs: Created the "Deep dive into focus tracking" guide. Closes ckeditor/ckeditor5#6087.
Additional information
Merge together with:
Follow-ups: