Skip to content

Callout macOS #1100

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

Merged
merged 92 commits into from
Nov 3, 2021
Merged

Callout macOS #1100

merged 92 commits into from
Nov 3, 2021

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Oct 28, 2021

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

Description of changes

This change adds a native module for macOS Callout. This is a fairly large change, be warned.
Implementing Callout also means we have a functional ContextualMenu, but I would not call it done, there's a lot of testing / bug fixing I need to do before I can declare that.
The focusOnMount/focusOnContainer props are mostly windows specific, so I did not implement those. It might be worth going through the types and marking "win32 only" and such.

Verification

I tested showing the Callout with a target view, anchor Rect, and as a cotextual menu. I tested that it behaves properly when at a border of the screen.

Screen Shot 2021-11-03 at 12 26 28 PM

callout_demo.mp4

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

@Saadnajmi Saadnajmi changed the title macOS Callout Callout macOS Oct 28, 2021
@@ -3,19 +3,17 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = 'FRNRadioButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused on this change. You're renaming radio button to be a callout?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think git got confused here, I'm making a new file but git thinks I'm renaming the old one. I'll see if I can make that go away

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah so what happened is this PR is so old it was back when we still had a separate NativeRadioButton package (instead of just having it in the same radio button package), and while I was working on it that package (and it's podspec) got deleted. Git interpreted that as me renaming the podspec.

@@ -0,0 +1,4 @@
#import <React/RCTTouchHandler.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are all of these in the header file? Can we just move them out to the .mm where they're needed? Also no interface needs to be defined here?

Copy link
Collaborator Author

@Saadnajmi Saadnajmi Nov 3, 2021

Choose a reason for hiding this comment

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

There is no .mm file, there are swift files, and I can't import objective C headers into Swift files, except by adding them here. I think this is actually the preferred way of adding objective X headers into a Swift class. Or at least, how I got it working with these weird half swift half objective c native modules that React Native has.

@Saadnajmi Saadnajmi merged commit ae20d8c into microsoft:master Nov 3, 2021
@Saadnajmi Saadnajmi deleted the callout branch November 3, 2021 22:23
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