Skip to content

Commit

Permalink
⬆️ Release new input-text, css-value-input, dropdown
Browse files Browse the repository at this point in the history
changes include:
• @acusti/input-text: update props.autoFocus to be rendered both as the react-specific autoFocus prop and as the native HTML autofocus attribute to ensure that the element has the correct behavior for focusable elements that live inside dialogues or popovers on show without causing warnings in the console (the lowercase version wasn’t even getting properly set on the rendered element)
• @acusti/css-value-input: update to latest version of @acusti/input-text
• @acusti/dropdown: update to latest version of @acusti/input-text
  • Loading branch information
acusti committed Feb 12, 2024
1 parent b298019 commit 9626462
Show file tree
Hide file tree
Showing 5 changed files with 1,183 additions and 1,182 deletions.
4 changes: 2 additions & 2 deletions packages/css-value-input/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acusti/css-value-input",
"version": "1.0.0-rc.11",
"version": "1.0.0-rc.13",
"type": "module",
"sideEffects": false,
"exports": "./dist/CSSValueInput.js",
Expand Down Expand Up @@ -51,7 +51,7 @@
},
"dependencies": {
"@acusti/css-values": "^1.0.2",
"@acusti/input-text": "^1.5.1",
"@acusti/input-text": "^1.5.3",
"clsx": "^2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/dropdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acusti/dropdown",
"version": "0.38.2",
"version": "0.38.4",
"type": "module",
"sideEffects": false,
"exports": "./dist/Dropdown.js",
Expand Down Expand Up @@ -53,7 +53,7 @@
"vitest": "^1.1.0"
},
"dependencies": {
"@acusti/input-text": "^1.5.1",
"@acusti/input-text": "^1.5.3",
"@acusti/matchmaking": "^0.6.1",
"@acusti/styling": "^0.7.2",
"@acusti/use-is-out-of-bounds": "^0.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/input-text/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acusti/input-text",
"version": "1.5.1",
"version": "1.5.3",
"type": "module",
"sideEffects": false,
"exports": "./dist/InputText.js",
Expand Down
7 changes: 4 additions & 3 deletions packages/input-text/src/InputText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ export default React.forwardRef<HTMLInputElement, Props>(function InputText(
const setInputElement = useCallback((element: InputRef) => {
inputRef.current = element;
_setInputElement(element);
if (element && autoFocus) {
element.setAttribute('autofocus', 'autofocus');
}
}, []);

if (inputRef.current && autoFocus && !inputRef.current.autofocus) {
inputRef.current.setAttribute('autofocus', 'autofocus');
}

// If props.initialValue changes, override input value from it
useEffect(() => {
if (!inputRef.current) return;
Expand Down
Loading

0 comments on commit 9626462

Please sign in to comment.