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

Fix/aut 3961/taofurigana ruby rt not focused #51

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

olga-kulish
Copy link

@olga-kulish olga-kulish commented Jan 3, 2025

Related to https://oat-sa.atlassian.net/browse/AUT-3961

Use with:

Deployed on:

Issue

In Chrome, in Authoring add a ruby tag --> <rt> is not focused automatically, so author can't type his furigana. If you press "arrow-right" to move cursor, then it's focused.
Fine in Firefox.

Probably, the cause of the issue is not a change in our code, but a change of native browser behavior for contenteditable in newer versions.

Fixed by moving cursor position one symbol after: ckeditor docs.

TODO:

  • test on Safari

Other issues:

I'm pretty sure these issues existed before too (= always). Still, let's at least take a look.

  • Placeholder &nbsp; (<rt>&nbsp;</rt>) is never removed, even after user enters his furigana, it stays in itemData
    • tried to use CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE instead, <rt> is fine then, but this sequence is sometimes appended after ruby?
    • should we use \200B (zero-width-space) instead, or even trim it in item-runner?
    • can we somehow modify DOM and remove it on blur for example? If taofurigana was an inline widget with downcast/upcast converters, it would have been possible. But it's a native html tag, so not sure.
  • If you remove this &nbsp; placeholder by pressing Del/Backspace, and don't enter any other text, you can no longer return and edit your ruby, even though it stays in the markup and itemData.
  • Strange cursor position when typing (at the end of <rb>, away from where the actual typing inside <rt> happens): browser contentediatble issue, try in playground: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable : <div contenteditable="true"><p><ruby><rb>とても長い言葉</rb><rt>&nbsp;</rt></ruby>で話す<ruby><rb>のわ楽しい</rb><rt>たのしい</rt></ruby>かもしれない</p></div>. Check ruby-align.

@olga-kulish olga-kulish changed the title fix: taofurigana: when new rt is created, focus is not moved inside it Fix/aut 3961/taofurigana ruby rt not focused Jan 3, 2025
@olga-kulish olga-kulish marked this pull request as draft January 3, 2025 11:48
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.

1 participant