-
Notifications
You must be signed in to change notification settings - Fork 162
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
Callout macOS #1100
Conversation
apps/fluent-tester/src/FluentTester/TestComponents/ContextualMenu/ContextualMenuTest.tsx
Show resolved
Hide resolved
@@ -3,19 +3,17 @@ require 'json' | |||
package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) | |||
|
|||
Pod::Spec.new do |s| | |||
s.name = 'FRNRadioButton' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Platforms Impacted
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.
callout_demo.mp4
Pull request checklist
This PR has considered (when applicable):