5htp-core 0.5.0-7 → 0.5.0-8

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": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.5.0-7",
4
+ "version": "0.5.0-8",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -77,15 +77,21 @@ export default (props: Props) => {
77
77
  )
78
78
  );
79
79
 
80
- // Autofocus elements
81
- focusContent( refContent.current );
82
-
83
80
  // Close when the user clicks elsewere tha the popover
84
81
  return blurable([ refCont.current, () => show(false) ])
85
82
  }
86
83
 
87
84
  }, [shown]);
88
85
 
86
+ React.useEffect(() => {
87
+ if (position !== undefined) {
88
+
89
+ // Autofocus elements once the final position has been set
90
+ focusContent( refContent.current );
91
+
92
+ }
93
+ }, [position]);
94
+
89
95
  /*----------------------------------
90
96
  - ATTRIBUTES
91
97
  ----------------------------------*/
@@ -41,7 +41,7 @@ export type TInputState<TValue> = {
41
41
  - HOOKS
42
42
  ----------------------------------*/
43
43
  export function useInput<TValue>(
44
- { value: externalValue, onChange, className, ...otherProps }: InputBaseProps<TValue>,
44
+ { value: externalValue, onChange, className, hint, ...otherProps }: InputBaseProps<TValue>,
45
45
  defaultValue: TValue,
46
46
  autoCommit: boolean = false
47
47
  ): [
@@ -71,7 +71,7 @@ export const focusContent = ( container: HTMLElement ) => {
71
71
 
72
72
  const toFocus = container.querySelector<HTMLInputElement | HTMLTextAreaElement | HTMLButtonElement>(
73
73
  'input, textarea, button.btn.primary, footer > button.btn'
74
- )// || container; // Is it useful ? Creating unwanted scroll issue on showing popover
74
+ ) || container; // Is it useful ? Creating unwanted scroll issue on showing popover
75
75
 
76
76
  toFocus?.focus();
77
77
  }