Skip to content

[General] Don't activate buttons on start#4120

Merged
j-piasecki merged 1 commit intomainfrom
@jpiasecki/dont-activate-buttons-on-start
Apr 27, 2026
Merged

[General] Don't activate buttons on start#4120
j-piasecki merged 1 commit intomainfrom
@jpiasecki/dont-activate-buttons-on-start

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

Changes shouldActivateOnStart on buttons to false - true breaks nested buttons on Android.

cc @m-bert - I don't recall why it was true in the first place, any chance that after #4116 it wouldn't have been needed anyway?

Test plan

Before Update
Screen.Recording.2026-04-24.at.14.34.36.mov
Screen.Recording.2026-04-24.at.14.34.17.mov

Copilot AI review requested due to automatic review settings April 24, 2026 12:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the default activation behavior for v3 “button” wrappers to avoid Android issues with nested buttons by no longer activating the underlying NativeViewGestureHandler immediately on touch start.

Changes:

  • Set shouldActivateOnStart to false for v3/components RawButton (and, transitively, BaseButton/RectButton/BorderlessButton built on it).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@m-bert
Copy link
Copy Markdown
Collaborator

m-bert commented Apr 27, 2026

cc @m-bert - I don't recall why it was true in the first place

This was changed in #4036 in order to get rid of strange platform dependent workarounds in buttons.

any chance that after #4116 it wouldn't have been needed anyway?

Probably. I think in that case we should also check if we should swap onBegin with onActivate in buttons (as you did in Touchable).

@j-piasecki
Copy link
Copy Markdown
Member Author

I think in that case we should also check if we should swap onBegin with onActivate in buttons (as you did in Touchable).

Do we want to do that in the buttons given, which are deprecated (and this will likely result in a behavior change)?

Copy link
Copy Markdown
Collaborator

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

Do we want to do that in the buttons given, which are deprecated (and this will likely result in a behavior change)?

If they work correctly after this, then we don't have to change it. I've looked at examples and they seem work (at least in case of callbacks) so I guess we can ship it :shipit:

@j-piasecki j-piasecki merged commit 93e3a32 into main Apr 27, 2026
7 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/dont-activate-buttons-on-start branch April 27, 2026 11:52
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.

3 participants