Skip to content

Conversation

@Saadnajmi
Copy link
Contributor

@Saadnajmi Saadnajmi commented Nov 29, 2022

Description

Remove some legacy code that unnecessarily overrides onBlur and onFocus in Pressable

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

As far as I can tell, we were unnecessarily overriding onFocus and onBlur in the desktop Pressable forks. This (may) have caused Pressable to fail shallow compare and re-render unnecessarily, affecting downstream components in FluentUI React Native. Those specific event handlers are already handled in Pressability.js and passed into Pressable via the {...eventHandlers} spread across React Native Core, windows, and macOS.

What

What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.

Screenshots

Add any relevant screen captures here from before or after your changes.

Testing

Tested in Playground.

playground.2022-12-11.20-30-55.mp4
Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow

@Saadnajmi Saadnajmi changed the title [Draft] Remove unnecessary overrides to onFocus and onBlur in Pressable. [Draft] Remove unnecessary overrides to onFocus and onBlur in Pressable Nov 29, 2022
@Saadnajmi Saadnajmi marked this pull request as ready for review December 12, 2022 04:39
@Saadnajmi Saadnajmi requested review from a team as code owners December 12, 2022 04:39
@Saadnajmi Saadnajmi changed the title [Draft] Remove unnecessary overrides to onFocus and onBlur in Pressable Remove unnecessary overrides to onFocus and onBlur in Pressable Dec 14, 2022
@Saadnajmi Saadnajmi merged commit a19090d into microsoft:main Dec 15, 2022
@Saadnajmi Saadnajmi deleted the pressable-overrides branch December 15, 2022 19:09
Saadnajmi added a commit to Saadnajmi/react-native-windows that referenced this pull request Dec 15, 2022
…icrosoft#10942)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit to Saadnajmi/react-native-windows that referenced this pull request Dec 15, 2022
…icrosoft#10942)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit to Saadnajmi/react-native-windows that referenced this pull request Dec 15, 2022
…icrosoft#10942)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit to Saadnajmi/react-native-windows that referenced this pull request Dec 15, 2022
…icrosoft#10942)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit that referenced this pull request Dec 15, 2022
…10942) (#11015)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit that referenced this pull request Dec 15, 2022
…10942) (#11014)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit that referenced this pull request Dec 15, 2022
…10942) (#11013)

* Remove unneccesary overrides

* Change files

* Add  test
Saadnajmi added a commit that referenced this pull request Dec 15, 2022
#11016)

* Remove unnecessary overrides to `onFocus` and `onBlur` in Pressable (#10942)

* Remove unneccesary overrides

* Change files

* Add  test

* Update change files
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.

2 participants