@bitrise/bitkit 12.93.1-alpha.2 → 12.93.1-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.93.1-alpha.2",
4
+ "version": "12.93.1-alpha.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -42,6 +42,12 @@ const ChipInput = ({
42
42
  }: ChipInputProps) => {
43
43
  const theme = useStyleConfig('ChipInput');
44
44
  const keyupHandler: KeyboardEventHandler<HTMLInputElement> = (ev) => {
45
+ const target = ev.currentTarget;
46
+ if (ev.key === 'Backspace' && target.value.length === 0) {
47
+ onRemove(value[value.length - 1]);
48
+ }
49
+ };
50
+ const keydownHandler: KeyboardEventHandler<HTMLInputElement> = (ev) => {
45
51
  const target = ev.currentTarget;
46
52
  if (ev.key.match(separator)) {
47
53
  ev.preventDefault();
@@ -52,8 +58,6 @@ const ChipInput = ({
52
58
  }
53
59
  target.value = '';
54
60
  }
55
- } else if (ev.key === 'Backspace' && target.value.length === 0) {
56
- onRemove(value[value.length - 1]);
57
61
  }
58
62
  };
59
63
  const pasteEventHandler: ClipboardEventHandler<HTMLInputElement> = (ev) => {
@@ -131,7 +135,8 @@ const ChipInput = ({
131
135
  _focusVisible={{ boxShadow: 'none' }}
132
136
  flexGrow="1"
133
137
  id={id}
134
- onKeyDown={keyupHandler}
138
+ onKeyDown={keydownHandler}
139
+ onKeyUp={keyupHandler}
135
140
  onPaste={pasteEventHandler}
136
141
  />
137
142
  {isInvalid && <Icon color="icon.negative" name="ErrorCircleFilled" position="absolute" right="16" />}