@bitrise/bitkit 12.96.0 → 12.97.0

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.96.0",
4
+ "version": "12.97.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -41,12 +41,6 @@ const TagsInput = ({
41
41
  ...rest
42
42
  }: TagsInputProps) => {
43
43
  const theme = useStyleConfig('TagsInput');
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
44
  const addValues = (maybeValues: string) => {
51
45
  const newValue = maybeValues.split(separator).filter((item) => item && !item.match(/\s/) && !value.includes(item));
52
46
  if (newValue.length > 0) {
@@ -59,6 +53,8 @@ const TagsInput = ({
59
53
  ev.preventDefault();
60
54
  addValues(target.value);
61
55
  target.value = '';
56
+ } else if (ev.key === 'Backspace' && target.value.length === 0) {
57
+ onRemove(value[value.length - 1]);
62
58
  }
63
59
  };
64
60
  const pasteEventHandler: ClipboardEventHandler<HTMLInputElement> = (ev) => {
@@ -125,24 +121,15 @@ const TagsInput = ({
125
121
  {item}
126
122
  </Tag>
127
123
  ))}
128
- {value.length === 0 && placeholder && (
129
- <Text
130
- color="sys.fg.subtle"
131
- pointerEvents="none"
132
- position="absolute"
133
- sx={{ ':has(+ :focus-visible)': { display: 'none' } }}
134
- >
135
- {placeholder}
136
- </Text>
137
- )}
138
124
  <chakra.input
139
125
  _focusVisible={{ boxShadow: 'none' }}
140
126
  flexGrow="1"
127
+ height="26px"
141
128
  id={id}
142
129
  onBlur={blurHandler}
143
130
  onKeyDown={keydownHandler}
144
- onKeyUp={keyupHandler}
145
131
  onPaste={pasteEventHandler}
132
+ placeholder={value.length === 0 ? placeholder : undefined}
146
133
  />
147
134
  {isInvalid && <Icon color="icon.negative" name="ErrorCircleFilled" position="absolute" right="16" />}
148
135
  </Box>