@nick-skriabin/glyph 0.1.8 → 0.1.9

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/dist/index.cjs CHANGED
@@ -1984,7 +1984,8 @@ function Input(props) {
1984
1984
  placeholder,
1985
1985
  style,
1986
1986
  focusedStyle,
1987
- multiline
1987
+ multiline,
1988
+ autoFocus
1988
1989
  } = props;
1989
1990
  const [internalValue, setInternalValue] = React15.useState(defaultValue);
1990
1991
  const [cursorPos, setCursorPos] = React15.useState(defaultValue.length);
@@ -2035,6 +2036,11 @@ function Input(props) {
2035
2036
  if (!focusCtx || !focusIdRef.current || !nodeRef.current) return;
2036
2037
  return focusCtx.register(focusIdRef.current, nodeRef.current);
2037
2038
  }, [focusCtx]);
2039
+ React15.useEffect(() => {
2040
+ if (autoFocus && focusCtx && focusIdRef.current) {
2041
+ focusCtx.requestFocus(focusIdRef.current);
2042
+ }
2043
+ }, [autoFocus, focusCtx]);
2038
2044
  React15.useEffect(() => {
2039
2045
  if (!focusCtx || !focusIdRef.current) return;
2040
2046
  const fid = focusIdRef.current;