Skip to content

Emit code changes when paste stops at an invalid character - #133

Open
dajiaohuang wants to merge 1 commit into
AlexMiniApps:masterfrom
dajiaohuang:fix/emit-invalid-paste-changes
Open

dajiaohuang wants to merge 1 commit into
AlexMiniApps:masterfrom
dajiaohuang:fix/emit-invalid-paste-changes

Conversation

@dajiaohuang

Copy link
Copy Markdown

When a numeric paste contains an invalid character, onPaste may already have written preceding characters and cleared the current field before returning. For example, pasting synthetic 1x into 9999 leaves 199, but subscribers receive no codeChanged notification, contrary to the documented event behavior.

Schedule change emission before that early return, preserving the existing paste validation and partial-input behavior. Add a Jasmine regression that checks the resulting fields, changed event and absence of completion.

Validation: a harness transpiling the actual component with TypeScript 5.0.4 and synthetic Angular/DOM mocks fails on the original missing event and passes with this change; git diff --check passes. The full Angular/Karma suite and added Jasmine spec were not executed. No real clipboard, account or verification service was used.

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.

1 participant