mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Break on `keyup` for case of `shift` key, instead of letting it trigger the typeahead. Fixes: #24152.
This commit is contained in:
		@@ -439,7 +439,6 @@ import {get_string_diff} from "../../src/util";
 | 
				
			|||||||
  , keydown: function (e) {
 | 
					  , keydown: function (e) {
 | 
				
			||||||
    const pseudo_keycode = get_pseudo_keycode(e);
 | 
					    const pseudo_keycode = get_pseudo_keycode(e);
 | 
				
			||||||
    if (this.trigger_selection(e)) {
 | 
					    if (this.trigger_selection(e)) {
 | 
				
			||||||
      if (!this.shown) return;
 | 
					 | 
				
			||||||
      e.preventDefault();
 | 
					      e.preventDefault();
 | 
				
			||||||
      this.select(e);
 | 
					      this.select(e);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -474,6 +473,11 @@ import {get_string_diff} from "../../src/util";
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
          break
 | 
					          break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // to stop typeahead from showing up momentarily
 | 
				
			||||||
 | 
					        // when shift + tabbing to a field with typeahead
 | 
				
			||||||
 | 
					        case 16: // shift
 | 
				
			||||||
 | 
					          return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
          var hideOnEmpty = false
 | 
					          var hideOnEmpty = false
 | 
				
			||||||
          if (e.keyCode === 8 && this.options.helpOnEmptyStrings) { // backspace
 | 
					          if (e.keyCode === 8 && this.options.helpOnEmptyStrings) { // backspace
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user