Skip to content

fix(ios): toggle only reports user taps - #107

Closed
prosenthal828 wants to merge 1 commit into
NativePHP:mainfrom
prosenthal828:fix/ios-toggle-programmatic-change
Closed

prosenthal828 wants to merge 1 commit into
NativePHP:mainfrom
prosenthal828:fix/ios-toggle-programmatic-change

Conversation

@prosenthal828

Copy link
Copy Markdown

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 starts true reported true as soon as the screen appeared, so a handler like $this->enabled = ! $this->enabled flipped 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 true logged 1 change event on open before the fix and 0 after. Taps still report false / true.

🤖 Generated with Claude Code

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>
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