Skip to content

Fix IME composition handling in option inputs#3183

Merged
Chartman123 merged 1 commit intonextcloud:mainfrom
don9x2E:fix/ime-composition-options
Feb 26, 2026
Merged

Fix IME composition handling in option inputs#3183
Chartman123 merged 1 commit intonextcloud:mainfrom
don9x2E:fix/ime-composition-options

Conversation

@don9x2E
Copy link
Contributor

@don9x2E don9x2E commented Feb 26, 2026

Summary

This PR now includes a follow-up fix after the initial IME handling patch.

  • Prevent unintended option creation while IME composition is in progress
  • Move new option creation for the local "Add a new answer option" row to explicit user intent
    • create only on Enter (after composition ends) or explicit + button click
  • Keep normal live updates for already-created options
  • Move focus to the next empty local option after creating one with Enter
  • Fix delayed "Delete form" confirmation dialog opening by rendering the dialog outside the actions slot

Why this follow-up was needed

The previous attempt improved composition guards, but real Korean IME usage still hit edge cases where input-driven side effects could trigger unexpectedly in the local option row.

In practice, automatic creation on input was still risky under composition timing differences across browsers/IME implementations.

Behavioral change and trade-off

The local empty option row no longer auto-creates an option purely from input events.
Instead, creation is explicit (Enter or + button).

This slightly reduces automation, but removes IME race/side-effect paths and gives deterministic behavior for CJK input users.

Repro (before)

  • Create form
  • Add multiple-choice/dropdown/radio options
  • Type Korean with IME in the local "Add a new answer option" field
  • Observe unexpected creation timing / side effects in some flows

Verification (after)

  • During IME composition: no automatic option creation
  • After composition ends: Enter creates exactly one option
  • + button creates exactly one option
  • Focus moves to the newly appended empty local option row
  • "Delete form" shows confirmation dialog immediately on click

@Chartman123 Chartman123 added bug Something isn't working javascript Javascript related ticket 3. to review Waiting for reviews feature: 📑 form creation labels Feb 26, 2026
@Chartman123
Copy link
Collaborator

@don9x2E thanks for your fix :) please sign-off your commit

Signed-off-by: don9x2E <revan@kakao.com>
@don9x2E don9x2E force-pushed the fix/ime-composition-options branch from 8916840 to 9ee83f1 Compare February 26, 2026 09:33
Copy link
Collaborator

@Chartman123 Chartman123 left a comment

Choose a reason for hiding this comment

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

Looks good from my point of view

@Chartman123
Copy link
Collaborator

/backport to stable5.2

@backportbot backportbot bot added the backport-request Pending backport by the backport-bot label Feb 26, 2026
@Chartman123 Chartman123 merged commit 66d0be7 into nextcloud:main Feb 26, 2026
46 checks passed
@backportbot backportbot bot removed the backport-request Pending backport by the backport-bot label Feb 26, 2026
@don9x2E
Copy link
Contributor Author

don9x2E commented Feb 26, 2026

Follow-up update pushed in commit 4b8ae6d.

What was added after the approved IME patch:

  • local option row now creates options only on explicit intent (Enter after composition end or + button)
  • focus moves to the next empty local option after creating one
  • delete-form confirmation dialog now opens immediately (moved out of actions slot)

This resolves the remaining Korean IME edge-case observed in real usage.

@don9x2E
Copy link
Contributor Author

don9x2E commented Feb 26, 2026

Design proposal only (no code change): restoring auto-create safely

If we want to bring back auto-create for the local option row later, a safer staged approach is:

  1. Keep current explicit mode as default.
  2. Re-enable auto-create only for non-IME input paths first.
  3. Add a strict guard layer for IME paths:
    • never create on input/composition events
    • allow create only after compositionend + explicit user intent (Enter/click)
  4. Add browser/IME matrix tests (Korean/Japanese/Chinese IME, Chromium/Firefox/WebKit).
  5. Optional feature flag (or config) to compare behavior before making it default.

Acceptance criteria for any auto-create restoration:

  • zero unintended creates during composition
  • exactly one create per explicit intent
  • stable focus behavior after creation
  • no regressions for existing option update flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working feature: 📑 form creation javascript Javascript related ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants