fix(ios): toggle only reports user taps - #107
Closed
prosenthal828 wants to merge 1 commit into
Closed
prosenthal828 wants to merge 1 commit into
prosenthal828 wants to merge 1 commit into
Conversation
Setting isOn from the server value (onAppear, a server push) also fired onChange(of: isOn), which sent a change event the user never made. A toggle whose value starts true reported true as soon as the screen appeared. Skip values matching the last one recorded, as the list item toggle already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On iOS,
<native:toggle>sent a change event when its value was set by the app, not only when the user tapped it. A toggle that startstruereportedtrueas soon as the screen appeared, so a handler like$this->enabled = ! $this->enabledflipped the setting by itself.Fix: skip values that match the last one recorded, the same guard the list item toggle already has.
Tested on the iOS 26.3 simulator: a screen with a toggle starting
truelogged 1 change event on open before the fix and 0 after. Taps still reportfalse/true.🤖 Generated with Claude Code