Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCTSwitch: Use NSSwitch instead of NSButton #924

Merged
merged 21 commits into from
Jan 25, 2022

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Dec 9, 2021

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

When this repo was created, NSSwitch didn't exist. So for <Switch>, we used an NSButton that was a checkbox. Now, apple introduced an actual NSSwitch for macOS 10.15+, and we can use it because we just bumped our minimum support to 10.15

Changelog

[macOS] [Changed] - Switched RCTSwitch to use NSSwitch instead of NSButton

Test Plan

RN Tester page for switch looks good

Screen Shot 2022-01-25 at 1 55 40 PM

Saadnajmi and others added 21 commits March 22, 2021 14:59
[pull] master from microsoft:master
[pull] master from microsoft:master
[pull] master from microsoft:master
* Deprecated api (microsoft#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (microsoft#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (microsoft#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (microsoft#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>

* Grammar fixes. (microsoft#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Saad Najmi <[email protected]>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>
@Saadnajmi Saadnajmi requested a review from alloy as a code owner December 9, 2021 05:30
@Saadnajmi
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Saadnajmi
Copy link
Collaborator Author

As an FYI, I'm waiting to merge this PR until we bump the minimum macOS to 10.15 on either master or the next stable branch we have, since that's when NSSwitch is introduced.

@Saadnajmi
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Saadnajmi Saadnajmi merged commit c2e966d into microsoft:main Jan 25, 2022
@Saadnajmi Saadnajmi deleted the nsswitch branch January 25, 2022 19:56
Saadnajmi added a commit to Saadnajmi/react-native-macos that referenced this pull request Feb 18, 2022
* add pull yml

* match handleOpenURLNotification event payload with iOS (microsoft#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* [pull] master from microsoft:master (#11)

* Deprecated api (microsoft#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (microsoft#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (microsoft#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (microsoft#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>

* Grammar fixes. (microsoft#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Saad Najmi <[email protected]>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>

* Use NSSwitch

* remove change from my fork

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>
Saadnajmi added a commit that referenced this pull request Feb 19, 2022
* RCTSwitch: Use NSSwitch instead of NSButton (#924)

* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* [pull] master from microsoft:master (#11)

* Deprecated api (#853)

* Remove deprecated/unused context param
* Update a few Mac deprecated APIs

* Packing RN dependencies, hermes and ignoring javadoc failure,  (#852)

* Ignore javadoc failure

* Bringing few more changes from 0.63-stable

* Fixing a patch in engine selection

* Fixing a patch in nuget spec

* Fixing the output directory of nuget pack

* Packaging dependencies in the nuget

* Fix onMouseEnter/onMouseLeave callbacks not firing on Pressable (#855)

* add pull yml

* match handleOpenURLNotification event payload with iOS (#755) (#2)

Co-authored-by: Ryan Linton <[email protected]>

* fix mouse evetns on pressable

* delete extra yml from this branch

* Add macOS tags

* reorder props to have onMouseEnter/onMouseLeave always be before onPress

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>

* Grammar fixes. (#856)

Updates simple grammar issues.

Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Saad Najmi <[email protected]>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>

* Use NSSwitch

* remove change from my fork

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>

* DynamicColorMacOS fixes (#1028)

* Use initWithDynamicProvider + Add HC Support

* Update log error

* replace all references to 10.14 (#938)

* Replace currentAppearance with currentDrawingAppearance on macOS 11+ (#1029)

* Manually cherry-pick #1012

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Ryan Linton <[email protected]>
Co-authored-by: Nick Trescases <[email protected]>
Co-authored-by: Anandraj <[email protected]>
Co-authored-by: Muhammad Hamza Zaman <[email protected]>
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