File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 13
13
- Refactored event handlers and callbacks to use ` on ` prefixes
14
14
- Refactored ` classNames ` option to avoid creating new and merging objects for each top-level props change
15
15
- Refactored ` deleteTag ` method so it no longer clears the input text when a tag is removed
16
+ - Refactored ` delimiters ` option to be an array of ` KeyboardEvent.key ` values
16
17
- Removed ` clearInputOnDelete ` option
17
18
- Removed ` autofocus ` option
18
19
- Removed ` delimiterChars ` option
Original file line number Diff line number Diff line change @@ -112,7 +112,16 @@ class ReactTags extends React.Component {
112
112
this . props . onInput ( query )
113
113
}
114
114
115
- if ( query !== this . state . query ) {
115
+ // NOTE: This test is a last resort for soft keyboards and browsers which do not
116
+ // support `KeyboardEvent.key`.
117
+ // <https://bugs.chromium.org/p/chromium/issues/detail?id=763559>
118
+ // <https://bugs.chromium.org/p/chromium/issues/detail?id=118639>
119
+ if (
120
+ query . length === this . state . query . length + 1 &&
121
+ this . props . delimiters . indexOf ( query . slice ( - 1 ) ) > - 1
122
+ ) {
123
+ pressDelimiter . call ( this )
124
+ } else if ( query !== this . state . query ) {
116
125
const options = getOptions . call ( this , query )
117
126
this . setState ( { query, options } )
118
127
}
You can’t perform that action at this time.
0 commit comments