-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search pills: Backspace should remove a search pill with typeahead open. #10092
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello @zulip/server-search members, this pull request was labeled with the "area: search" label, so you may want to check it out! |
|
shubham-padia
force-pushed
the
advance_key_codes
branch
from
July 28, 2018 16:50
6183aa7
to
4184291
Compare
Partially fixes zulip#10026. Typeaheads stopped propogation of keydown and keyup events for any key except tab and enter. If stopAdvance was true even tab and enter were not allowed. advanceKeyCodes option was added to typeahead which allowed to specify key codes for which propogation of keydown and keyup events should not stop. advanceKeyCodes does not respect the stopAdvance option. As the backspace key code is added to advanceKeyCodes in search.js, the backspace key deletes pill on pressing backspace if input is empty or only consists of spaces.
shubham-padia
force-pushed
the
advance_key_codes
branch
from
July 28, 2018 17:58
4184291
to
f3aad89
Compare
Merged, after fixing the trailing whitespace in Thanks @shubham-padia! |
evykassirer
added a commit
to evykassirer/zulip
that referenced
this pull request
Mar 7, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
evykassirer
added a commit
to evykassirer/zulip
that referenced
this pull request
Mar 10, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
evykassirer
added a commit
to evykassirer/zulip
that referenced
this pull request
Mar 10, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
evykassirer
added a commit
to evykassirer/zulip
that referenced
this pull request
Mar 11, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
evykassirer
added a commit
to evykassirer/zulip
that referenced
this pull request
Mar 11, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
timabbott
pushed a commit
that referenced
this pull request
Mar 11, 2024
The `advanceKeyCodes` option was introduced in #10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
Shgit29
pushed a commit
to Shgit29/zulip
that referenced
this pull request
Mar 13, 2024
The `advanceKeyCodes` option was introduced in zulip#10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially fixes #10026.
Typeaheads stopped propogation of keydown and keyup events for any
key except tab and enter. If stopAdvance was true even tab and enter
were not allowed.
advanceKeyCodes option was added to typeahead which allowed to specify
key codes for which propogation of keydown and keyup events should not
stop. advanceKeyCodes does not respect the stopAdvance option.
As the backspace key code is added to advanceKeyCodes in search.js,
the backspace key deletes pill on pressing backspace if input is empty
or only consists of spaces.
I'm not sure why the all the key codes except tab and enter aren't allowed.
Another approach would have been to allow backspace for all typeaheads without adding the
advanceKeyCodes
option, but I figured it would safer to allow it only for the search typeahead.