devopsinthecloud icon indicating copy to clipboard operation
devopsinthecloud copied to clipboard

Mentions chooser view showing initially for no reason

Open arielpollack opened this issue 5 years ago • 3 comments

Hey, I've updated to 7.1.0 and now the mentions chooser opens right away on textView.becomeFirstResponder().

It looks like the issue is with this check: 6.0.1 ... 7.1.0

if ((self.state != HKWMentionsCreationStateQuiescent || self.searchType == HKWMentionsSearchTypeInitial)
        && self.chooserState == HKWMentionsCreationChooserStateHidden) {
        [self showChooserView];
    }

HKWMentionsPlugin calls the state machine's fetchInitialMentions method which set's the searchType to Initial and make this check succeed initially and thus shows the chooser view.

I don't understand the logic completely in order to fix it or point where the issue is, but currently, I need to rollback to the previous version as this one is not production ready for our usage.

arielpollack avatar Apr 22 '19 12:04 arielpollack

I am facing the same issue, and this happen since 6.0.2

caroltam avatar May 29 '19 02:05 caroltam

@caroltam as a workaround I'm just returning with no call to the completion block in case the searchType is HKWMentionsSearchTypeInitial:

- (void)asyncRetrieveEntitiesForKeyString:(NSString *)keyString
                               searchType:(HKWMentionsSearchType)type
                         controlCharacter:(unichar)character
                               completion:(void (^)(NSArray *, BOOL, BOOL))completionBlock {
    if (!completionBlock || type == HKWMentionsSearchTypeInitial) {
        return;
    }
    ....

arielpollack avatar May 29 '19 14:05 arielpollack

@arielpollack thank you!

nkark avatar Jun 03 '19 21:06 nkark