diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2021-12-01 10:24:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 10:24:16 -0500 |
commit | 9a670c3b995337f0d3cf865a18761bdfe89f16d9 (patch) | |
tree | 209682626c0326e922a14e92c0f3c77cc5b12af3 | |
parent | e180db39aeac6d44df0c063fd6753316197184a9 (diff) | |
parent | 7fb64b9ab7ed3da9fff980bc11e9882cd9c8d188 (diff) | |
download | sdl_ios-hotfix/7.3.1.tar.gz |
Merge pull request #2065 from smartdevicelink/bugfix/issue-2064-incorrect-keyboard-responsehotfix/7.3.1
Fix searchable choice set callbacks are incorrect
-rw-r--r-- | SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m b/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m index a2d42c333..692013e08 100644 --- a/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m +++ b/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m @@ -162,6 +162,8 @@ typedef NS_ENUM(NSUInteger, SDLPreloadPresentChoicesOperationState) { [super start]; if (self.isCancelled) { return; } + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_keyboardInputNotification:) name:SDLDidReceiveKeyboardInputNotification object:nil]; + // If we have no loaded cells, reset choice ids to ensure reconnections restart numbering if (self.loadedCells.count == 0) { SDLPreloadPresentChoicesOperationUtilities.choiceId = 0; @@ -311,8 +313,6 @@ typedef NS_ENUM(NSUInteger, SDLPreloadPresentChoicesOperationState) { self.currentState = SDLPreloadPresentChoicesOperationStateUpdatingKeyboardProperties; if (self.keyboardDelegate == nil) { return completionHandler(nil); } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_keyboardInputNotification:) name:SDLDidReceiveKeyboardInputNotification object:nil]; - // Check if we're using a keyboard (searchable) choice set and setup keyboard properties if we need to if (self.keyboardDelegate != nil && [self.keyboardDelegate respondsToSelector:@selector(customKeyboardConfiguration)]) { SDLKeyboardProperties *customProperties = self.keyboardDelegate.customKeyboardConfiguration; @@ -366,8 +366,10 @@ typedef NS_ENUM(NSUInteger, SDLPreloadPresentChoicesOperationState) { } SDLPerformInteractionResponse *performResponse = response; - [weakself sdl_setSelectedCellWithId:performResponse.choiceID]; - weakself.selectedTriggerSource = performResponse.triggerSource; + if (![performResponse.triggerSource isEqualToEnum:SDLTriggerSourceKeyboard]) { + [weakself sdl_setSelectedCellWithId:performResponse.choiceID]; + weakself.selectedTriggerSource = performResponse.triggerSource; + } return completionHandler(error); }]; |