Skip to content
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

Docs: Multiple root editor sample and tutorial added #1586

Merged
merged 27 commits into from
Mar 6, 2019
Merged

Docs: Multiple root editor sample and tutorial added #1586

merged 27 commits into from
Mar 6, 2019

Conversation

f1ames
Copy link
Contributor

@f1ames f1ames commented Feb 28, 2019

Suggested merge commit message (convention)

Docs: Multiple root editor sample and tutorial added. Closes #1447.


Additional information

See #1447 and https://github.com/ckeditor/ckeditor5-editor-decoupled/issues/21.

There are two things I'm not 100% sure about. The naming of the editor type which is Multiple root editor - generally it makes sense for us, but not sure how easy to find it will be for the users/developers interested in such editor type. I took a look on other editors and usually it is something like shared toolbar, but it covers a little different cases.

The other thing is the content of the sample itself, I used the content from Inline build sample, because it has four containers so works nicely with multiple root editor and can be used to see what is the difference between multiple root editor and the approach using multiple editor instances. My doubt is that it may be confusing that we have two samples with the same content.

@f1ames f1ames requested a review from Reinmar February 28, 2019 10:07
@Reinmar
Copy link
Member

Reinmar commented Mar 5, 2019

Wow🎉 It works and looks great. From my side I see that some wording will need to be polished, but nothing big. Great job :)

@Reinmar
Copy link
Member

Reinmar commented Mar 5, 2019

Reviewed from my side. Leaving the source code to @oleq.

@Reinmar Reinmar requested a review from oleq March 5, 2019 15:27
@Reinmar
Copy link
Member

Reinmar commented Mar 5, 2019

image

// it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
// Doing otherwise will result in editable focus styles disappearing, once e.g. the
// toolbar gets focused.
editable.bind( 'isFocused' ).to( this.focusTracker );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all roots are marked as focused when just one has focus at a time? This is not the right UX.

image

The relation with the FT should be different in this multi–root editor:

  • if any editable is focused -> FT#isFocused === true
  • if an editable is focused, only that editable gets focused styles as per EditableUIView

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had some discussion with @pjasiun some time ago about this case - https://github.com/ckeditor/ckeditor5-editor-decoupled/issues/21#issuecomment-448943315 (the outcome was that it is acceptable). However, if it can be easily changed with the current API, I'm in favor of making this change to have only one root marked as focused at the same time.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to change it, that's fine, but TBH I like it this way. It stresses the fact that this is a single editor.

// it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
// Doing otherwise will result in editable focus styles disappearing, once e.g. the
// toolbar gets focused.
editable.bind( 'isFocused' ).to( this.focusTracker );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in MultirootEditorUI#init(). All editables cannot share the same isFocused state.

editingView.attachDomRoot( editableElement, editable.name );
}

this._initPlaceholder();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it work? I assume the same placeholder text is set to all roots, which does not make sense in most cases IMO. It would take editor.config.placeholder defined as { root: 'Root placeholder text', ... } to make this right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the same placeholder text is set to all roots, which does not make sense in most cases IMO.

Yes, this is the way it works in this implementation. It would make much more sense to use it with { root: 'Root placeholder text', ... } as you mentioned, however it will require some changes in placeholder code (probably mostly docs?). I assume we could cover this as a follow-up?

@Reinmar
Copy link
Member

Reinmar commented Mar 6, 2019

I'm going to merge this because it actually works (with some minor issues). Let's fix the rest on stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants