-
Notifications
You must be signed in to change notification settings - Fork 167
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
Fix an issue when call onKeyUp handler in PickerPlugin #297
Merged
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
titrongt
reviewed
Apr 29, 2019
let shortWord = wordBeforeCursor.substring(1).trim(); | ||
this.dataProvider.queryStringUpdated(shortWord); | ||
const wordBeforeCursorWithoutTriggerChar = wordBeforeCursor.substring(1); | ||
let trimmedWordBeforeCursor = wordBeforeCursorWithoutTriggerChar.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wish these two lines didn't have to be repeated, but code looks good to me otherwise
titrongt
approved these changes
Apr 29, 2019
JiuqingSong
added a commit
that referenced
this pull request
Apr 29, 2019
* 7.1.1 * 7.1.2 Fix #218 (#219) * 7.1.2 Fix #218 * Fix typo * Track content changed events and report up to PickerPluginDataProvider (#222) * Refactor ReplaceWithNode to use the editor core API (#223) * Address comments raised in #225 but not addressed (#227) * Fix a js error in insertNode (#229) * 7.2.0 (#230) * Fix 4 issues (#234) * Fix #74 (#236) * Fix #74 * Fix #74 * address comments * Replace deprecated TSLint extension with MSFT TSLint (#240) * 7.2.1 (#243) * stopPropagation for key inputs (#245) * Make picker plugin generic (#246) * Make PickerPlugin generic * fix build * Selection Management step 1 (#247) * Selection management step 1: New core API selectRange * Fix build * fix comment * Fix keyboard event issue (#251) * Improve hyperlink onLinkClick option (#255) Allow Hyperlink onLinkClick to fall back to default handling to reduce redundant code. * Bump version (#256) * fix autolink bug (#263) * Filter CTRL+Click for Hyperlink plugin to main button (#262) * 7.2.5 (#265) * Fix some perf issue and some other changes (#272) * 45000 * 7.2.6 * init commit * syntax error * remove Input event so doesn't re-autocomplete * StopPropagation for Input event (#276) * Re-implemented the processList API. (#275) * revert unneded changes and add check for char val * ready for pr * forgot 0 case again * export from root * undefined --> null, removes attribute instead of set as undefined * Fix #279 (#281) * take out unwanted change * try that again * 7.3.0 (#282) * Add dark mode publish variant (#284) * Fix #286 (#287) * init commit * add charcodes * Fix #290 (#291) * 7.3.1 (#294) * 7.3.1-darkmode.0 * Fix an issue when call onKeyUp handler in PickerPlugin (#297) * Check isSuggesting for function key in PickerPlugin * 7.3.2 * Fix emoji reappear issue when space after backspace
JiuqingSong
added a commit
that referenced
this pull request
Jun 10, 2019
* 7.1.1 * 7.1.2 Fix #218 (#219) * 7.1.2 Fix #218 * Fix typo * Track content changed events and report up to PickerPluginDataProvider (#222) * Refactor ReplaceWithNode to use the editor core API (#223) * Address comments raised in #225 but not addressed (#227) * Fix a js error in insertNode (#229) * 7.2.0 (#230) * Fix 4 issues (#234) * Fix #74 (#236) * Fix #74 * Fix #74 * address comments * Replace deprecated TSLint extension with MSFT TSLint (#240) * 7.2.1 (#243) * stopPropagation for key inputs (#245) * Make picker plugin generic (#246) * Make PickerPlugin generic * fix build * Selection Management step 1 (#247) * Selection management step 1: New core API selectRange * Fix build * fix comment * Fix keyboard event issue (#251) * Improve hyperlink onLinkClick option (#255) Allow Hyperlink onLinkClick to fall back to default handling to reduce redundant code. * Bump version (#256) * fix autolink bug (#263) * Filter CTRL+Click for Hyperlink plugin to main button (#262) * 7.2.5 (#265) * Fix some perf issue and some other changes (#272) * 45000 * 7.2.6 * init commit * syntax error * remove Input event so doesn't re-autocomplete * StopPropagation for Input event (#276) * Re-implemented the processList API. (#275) * revert unneded changes and add check for char val * ready for pr * forgot 0 case again * export from root * undefined --> null, removes attribute instead of set as undefined * Fix #279 (#281) * take out unwanted change * try that again * 7.3.0 (#282) * Add dark mode publish variant (#284) * Fix #286 (#287) * init commit * add charcodes * Fix #290 (#291) * 7.3.1 (#294) * Fix an issue when call onKeyUp handler in PickerPlugin (#297) * Check isSuggesting for function key in PickerPlugin * 7.3.2 * Fix emoji reappear issue when space after backspace * Export code to codepen from demo site (#289) * init commit * move order one down * mouseUp before * Add more comments to improve doc (#302) * Improve doc * Add more comments * Fix cursor stuck at list issue (#303) * Fix cursor stuck at list issue * fix build * Add getTextContent * address comments for getTextContent * Address comment * change some element to use the class param * remove comments * 7.4.0 (#308)
JiuqingSong
added a commit
that referenced
this pull request
Jun 11, 2019
* 7.1.1 * 7.1.2 Fix #218 (#219) * 7.1.2 Fix #218 * Fix typo * Track content changed events and report up to PickerPluginDataProvider (#222) * Refactor ReplaceWithNode to use the editor core API (#223) * Address comments raised in #225 but not addressed (#227) * Fix a js error in insertNode (#229) * 7.2.0 (#230) * Fix 4 issues (#234) * Fix #74 (#236) * Fix #74 * Fix #74 * address comments * Replace deprecated TSLint extension with MSFT TSLint (#240) * 7.2.1 (#243) * stopPropagation for key inputs (#245) * Make picker plugin generic (#246) * Make PickerPlugin generic * fix build * Selection Management step 1 (#247) * Selection management step 1: New core API selectRange * Fix build * fix comment * Fix keyboard event issue (#251) * Improve hyperlink onLinkClick option (#255) Allow Hyperlink onLinkClick to fall back to default handling to reduce redundant code. * Bump version (#256) * fix autolink bug (#263) * Filter CTRL+Click for Hyperlink plugin to main button (#262) * 7.2.5 (#265) * Fix some perf issue and some other changes (#272) * 45000 * 7.2.6 * init commit * syntax error * remove Input event so doesn't re-autocomplete * StopPropagation for Input event (#276) * Re-implemented the processList API. (#275) * revert unneded changes and add check for char val * ready for pr * forgot 0 case again * export from root * undefined --> null, removes attribute instead of set as undefined * Fix #279 (#281) * take out unwanted change * try that again * 7.3.0 (#282) * Add dark mode publish variant (#284) * Fix #286 (#287) * init commit * add charcodes * Fix #290 (#291) * 7.3.1 (#294) * Fix an issue when call onKeyUp handler in PickerPlugin (#297) * Check isSuggesting for function key in PickerPlugin * 7.3.2 * Fix emoji reappear issue when space after backspace * Export code to codepen from demo site (#289) * init commit * move order one down * mouseUp before * Add more comments to improve doc (#302) * Improve doc * Add more comments * Fix cursor stuck at list issue (#303) * Fix cursor stuck at list issue * fix build * Add getTextContent * address comments for getTextContent * Address comment * change some element to use the class param * remove comments * 7.4.0 (#308) * Revert #298 since it breaks IE (#310) * revert #298 * 7.4.1
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.
A recent change makes onKeyUp handler will be called when functional keys like Backspace, ... are pressed. This causes isSuggesting is set to true even when it was not suggesting.
In this change, I make it check isCharacterValue as well:
isSuggesting && isCharacterValue => call onKeyUp
isSuggesting && !isCharacterValue && !isModifierKey => call onKeyUp
isSuggesting && isModifierKey => NOT call onKeyUp
!isSuggesting && isCharacterValue => call onKeyUp
!isSuggesting && !isCharacterValue && !isModifierKey => NOT call onKeyUp
!isSuggesting && isModifierKey => NOT call onKeyUp