mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
fix(iOS): enable/disable keyboard shortcuts only on iOS (#48518)
Summary: This PR guards code that enables/disables keyboard shortcuts only on iOS (iPadOS included).  ## Changelog: [IOS] [FIXED] - enable/disable keyboard shortcuts only on iOS Pull Request resolved: https://github.com/facebook/react-native/pull/48518 Test Plan: CI Green Reviewed By: rshest Differential Revision: D67900442 Pulled By: javache fbshipit-source-id: 249a7c3124d02d2c30303d218e2b26e987ae1f0f
This commit is contained in:
1 parent
38c46fe865
commit
8b0af4542e
3 files changed
+6
No files matched your search
@@ -138,6 +138,7 @@ static UIColor *defaultPlaceholderColor(void)
|
||||
|
||||
- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
|
||||
{
|
||||
#if TARGET_OS_IOS
|
||||
// Initialize the initial values only once
|
||||
if (_initialValueLeadingBarButtonGroups == nil) {
|
||||
// Capture initial values of leading and trailing button groups
|
||||
@@ -154,6 +155,7 @@ static UIColor *defaultPlaceholderColor(void)
|
||||
self.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
|
||||
}
|
||||
_disableKeyboardShortcuts = disableKeyboardShortcuts;
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - Overrides
|
||||
|
||||
@@ -400,6 +400,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
|
||||
- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
|
||||
{
|
||||
#if TARGET_OS_IOS
|
||||
// Initialize the initial values only once
|
||||
if (_initialValueLeadingBarButtonGroups == nil) {
|
||||
// Capture initial values of leading and trailing button groups
|
||||
@@ -415,6 +416,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
self.backedTextInputView.inputAssistantItem.leadingBarButtonGroups = _initialValueLeadingBarButtonGroups;
|
||||
self.backedTextInputView.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - RCTBackedTextInputDelegate
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
|
||||
- (void)setDisableKeyboardShortcuts:(BOOL)disableKeyboardShortcuts
|
||||
{
|
||||
#if TARGET_OS_IOS
|
||||
// Initialize the initial values only once
|
||||
if (_initialValueLeadingBarButtonGroups == nil) {
|
||||
// Capture initial values of leading and trailing button groups
|
||||
@@ -137,6 +138,7 @@
|
||||
self.inputAssistantItem.trailingBarButtonGroups = _initialValueTrailingBarButtonGroups;
|
||||
}
|
||||
_disableKeyboardShortcuts = disableKeyboardShortcuts;
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - Placeholder
|
||||
|
||||
Reference in new issue
Block a user