Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

i/6087: Created the "Deep dive into focus tracking" guide. #552

Merged
merged 17 commits into from
Apr 7, 2020
Merged

Conversation

oleq
Copy link
Member

@oleq oleq commented Apr 3, 2020

@oleq oleq requested a review from Reinmar April 3, 2020 14:36
@coveralls
Copy link

coveralls commented Apr 3, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 6ae88a7 on i/6087 into 6cd15de on master.


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.
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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.

@Reinmar
Copy link
Member

Reinmar commented Apr 3, 2020

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 focus-tracking.html#focus-in-the-editor-ui but after reading this guide I can't recall this being mentioned, so perhaps some sort of summary is needed. Perhaps this would be a good place:

@Reinmar
Copy link
Member

Reinmar commented Apr 3, 2020

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.

@oleq
Copy link
Member Author

oleq commented Apr 6, 2020

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.

TBH, I couldn't find any good place to explain it earlier. Do you have any idea where could it be?

@Reinmar
Copy link
Member

Reinmar commented Apr 6, 2020

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).

@oleq
Copy link
Member Author

oleq commented Apr 6, 2020

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).

@Reinmar Reinmar merged commit d72646e into master Apr 7, 2020
@Reinmar Reinmar deleted the i/6087 branch April 7, 2020 19:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deep dive for focus tracking
3 participants