@@ -52,6 +52,7 @@
5252@property (nonatomic, assign) BOOL destructive;
5353@property (nonatomic, assign) BOOL primary;
5454@property (nonatomic, assign) BOOL buttonEnabled;
55+@property (nonatomic, copy) RCTDirectEventBlock onEmojiPick;
5556@end
5657
5758@implementation RCTNativeButtonView
@@ -66,10 +67,27 @@
6667 return self;
6768}
6869
70+- (BOOL)acceptsFirstResponder { return _onEmojiPick != nil; }
71+
6972- (void)handlePress {
73+ if (_onEmojiPick) {
74+ [self.window makeFirstResponder:self];
75+ [NSApp orderFrontCharacterPalette:nil];
76+ return;
77+ }
7078 if (_onPressButton) _onPressButton(@{});
7179}
7280
81+- (void)insertText:(id)string {
82+ if (_onEmojiPick && [string isKindOfClass:[NSString class]]) {
83+ _onEmojiPick(@{@"emoji": string});
84+ }
85+}
86+
87+- (void)doCommandBySelector:(SEL)selector {
88+ // Required by NSTextInputClient protocol — ignore commands
89+}
90+
7391- (void)mouseEntered:(NSEvent *)event {
7492 if (_borderlessHover) {
7593 ((RCTBorderlessButtonCell *)_button.cell).hovered = YES;
@@ -170,6 +188,7 @@ RCT_EXPORT_VIEW_PROPERTY(destructive, BOOL)
170188RCT_EXPORT_VIEW_PROPERTY(primary, BOOL)
171189RCT_EXPORT_VIEW_PROPERTY(buttonEnabled, BOOL)
172190RCT_EXPORT_VIEW_PROPERTY(onPressButton, RCTDirectEventBlock)
191+RCT_EXPORT_VIEW_PROPERTY(onEmojiPick, RCTDirectEventBlock)
173192@end
174193
175194// ============================================================