@onewelcome/react-lib-components 0.2.0 → 0.2.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@onewelcome/react-lib-components",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": "OneWelcome B.V.",
6
6
  "main": "dist/index.js",
@@ -14,7 +14,8 @@ export const useWrapper = (value?: string, placeholder?: string, type?: InputTyp
14
14
  (value?.length && value.length > 0) ||
15
15
  placeholder ||
16
16
  type === 'datetime-local' ||
17
- type === 'time'
17
+ type === 'time' ||
18
+ type === 'date'
18
19
  ) {
19
20
  setFloatingLabelActive(true);
20
21
  }
@@ -23,7 +24,13 @@ export const useWrapper = (value?: string, placeholder?: string, type?: InputTyp
23
24
  useEffect(() => {
24
25
  if ((value?.length && value.length > 0) || hasFocus) {
25
26
  setFloatingLabelActive(true);
26
- } else if (!placeholder && !hasFocus && type !== 'datetime-local' && type !== 'time') {
27
+ } else if (
28
+ !placeholder &&
29
+ !hasFocus &&
30
+ type !== 'datetime-local' &&
31
+ type !== 'time' &&
32
+ type !== 'date'
33
+ ) {
27
34
  setFloatingLabelActive(false);
28
35
  }
29
36
  }, [value, placeholder, type, hasFocus]);