Skip to content

fix: removing conflicting styles - #721

Merged
kacperzolkiewski merged 1 commit into
mainfrom
@kacperzolkiewski/fix-text-shortcuts
Jul 23, 2026
Merged

kacperzolkiewski merged 1 commit into
mainfrom
@kacperzolkiewski/fix-text-shortcuts

Conversation

@kacperzolkiewski

Copy link
Copy Markdown
Collaborator

Summary

Fix removing conflicting styles when applying paragraph style through shortcut

Test Plan

  1. Type bolded text in paragraph
  2. move cursor to the beginning
  3. insert codeblock through text shortcuts feature
  4. bold should be deleted from this line

Screenshots / Videos

Before:

Screen.Recording.2026-07-22.at.13.49.12.mov

After:

Screen.Recording.2026-07-22.at.13.49.50.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a formatting edge case when applying paragraph-level styles via text shortcuts (e.g., codeblock) so that conflicting inline styles (like bold/italic) are removed appropriately rather than being retained on the line/paragraph.

Changes:

  • iOS: remove conflicting styles across the entire paragraph (not just at the cursor) before applying the block/paragraph style.
  • Android: route paragraph-shortcut style application through verifyAndToggleStyle(...) so conflicts/blocks are verified and conflicting styles are removed consistently.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ios/utils/ShortcutsUtils.mm Expands conflict-removal range to the full paragraph before applying a paragraph/block style shortcut.
android/src/main/java/com/swmansion/enriched/textinput/utils/ShortcutsHandler.kt Uses verifyAndToggleStyle when applying shortcut styles to ensure conflicts are handled during toggling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kacperzolkiewski
kacperzolkiewski merged commit 039fd28 into main Jul 23, 2026
9 checks passed
@kacperzolkiewski
kacperzolkiewski deleted the @kacperzolkiewski/fix-text-shortcuts branch July 23, 2026 05:25
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.

3 participants