Add firePhxChangeWhileComposing opt to live_socket #3582
+15
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Through issue #3322, I observed the problem with Safari and IME composition for languages like Japanese, where firing phx-change during a composition session can cause unexpected behavior. However, for Korean input, the current behavior of skipping phx-change during composition introduces its own issues.
In Korean, even while composing, each intermediate character (e.g., 가) is considered a meaningful and complete character, even though it may later change to another (e.g., 각). As a result, treating intermediate characters as valid inputs and firing phx-change during composition is crucial for proper functionality. The current default behavior of skipping phx-change during isComposing does not align with the needs of Korean input users and would likely not be desirable for anyone using Korean.
To address this, I’ve added an explicit configuration option, opts.firePhxChangeWhileComposing, allowing developers to control whether phx-change should fire during composition sessions. While the default remains unchanged(�false), this option enables developers to adjust the behavior based on their application’s language and input requirements.
This change ensures greater flexibility for IME-based input scenarios, particularly for languages like Korean where the current behavior is problematic.