Skip to content

Conversation

kido-luci
Copy link

@kido-luci kido-luci commented May 26, 2025

Description

*On iOS, we need to handle a special case where user input modifies a previous word. For example, in Vietnamese keyboard with the Telex input method,the word "dinh" becomes "đinh" when the user types "d". iOS handles this by deleting several characters from the end of the word to the beginning (plus one extra character) and then re-inserting the updated characters.

The issue arises when the word is adjacent to an embedded object (e.g., an embedded block). iOS may accidentally remove the embedded object character (\uFFFC) during this replacement process. To prevent this, we should skip updating the text value if the change affects the starting character and is next to an embedded block.*

Related Issues

Embedded block is deleted after input a special Vietnamese character#2578.

Type of Change

  • Feature: New functionality without breaking existing features.
  • 🛠️ Bug fix: Resolves an issue without altering current behavior.
  • 🧹 Refactor: Code reorganization, no behavior change.
  • Breaking: Alters existing functionality and requires updates.
  • 🧪 Tests: New or modified tests
  • 📝 Documentation: Updates or additions to documentation.
  • 🗑️ Chore: Routine tasks, or maintenance.
  • Build configuration change: Build/configuration changes.

Fixed demo

Simulator Screen Recording - iPhone 16 Plus - 2025-05-26 at 20 11 50

// during this replacement process. To prevent this,
// we should skip updating the text value
// if the change affects the starting character and is next to an embedded block.
if (Platform.isIOS) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please, use isIos getter, instead of Platform.isIos to avoid issues with the web.

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.

2 participants