Phenomenon
When the dir attribute is changed dynamically on a contenteditable region (e.g., switching between ltr and rtl), the text direction may not update correctly during active editing in Firefox. The caret position and text flow may be incorrect.
Reproduction example
- Create a contenteditable div with
dir="ltr". - Start typing some text.
- Change
dirto"rtl"programmatically. - Continue typing.
- Observe the text direction and caret position.
Observed behavior
- In Firefox on Windows, changing
dirduring editing may not take effect immediately. - The caret position may be incorrect.
- Text flow may not update properly.
Expected behavior
- The
dirattribute should update text direction immediately. - Caret position should adjust correctly.
- Text flow should reflect the new direction.