Phenomenon
When applying a text color to selected text in Chrome and then continuing to type, the new text inherits the color. This is the expected behavior and works correctly in Chrome/Edge.
Reproduction example
- Select some text in a contenteditable element
- Apply a text color (e.g., red)
- Place cursor after the colored text
- Type new text
Observed behavior
- The newly typed text inherits the applied color
- Color formatting persists for new text
- This is the correct and expected behavior
- Works consistently in Chrome/Edge
Expected behavior
- Newly typed text should inherit the color (current behavior is correct)
- Color formatting should persist until explicitly changed
- Behavior should be consistent (which it is in Chrome/Edge)
Browser Comparison
- Chrome/Edge: Color persists correctly (this case - correct behavior)
- Firefox: Color persistence may be less reliable
- Safari: Color may not persist
Notes and possible direction for workarounds
- This behavior is correct and expected
- May need to handle color removal explicitly
- Consider if color should persist across paragraphs
- Document expected behavior for users