@oslokommune/punkt-react 16.0.0 → 16.0.2

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": "@oslokommune/punkt-react",
3
- "version": "16.0.0",
3
+ "version": "16.0.2",
4
4
  "description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@lit-labs/ssr-dom-shim": "^1.2.1",
41
41
  "@lit/react": "^1.0.7",
42
- "@oslokommune/punkt-elements": "^16.0.0",
42
+ "@oslokommune/punkt-elements": "^16.0.2",
43
43
  "classnames": "^2.5.1",
44
44
  "prettier": "^3.3.3",
45
45
  "react-hook-form": "^7.53.0"
@@ -109,5 +109,5 @@
109
109
  "url": "https://github.com/oslokommune/punkt/issues"
110
110
  },
111
111
  "license": "MIT",
112
- "gitHead": "b3e88b7c06f9a63c2e911693af6b9860cd73c27b"
112
+ "gitHead": "78107e738894fed2f40d8baad0273c29d58544f0"
113
113
  }
@@ -47,6 +47,11 @@ export const DatepickerInputs = ({ state }: { state: IDatepickerState }) => {
47
47
  restProps,
48
48
  } = state
49
49
 
50
+ const handleInputClick = (e: React.MouseEvent<HTMLInputElement>) => {
51
+ e.preventDefault()
52
+ toggleCalendar()
53
+ }
54
+
50
55
  const renderCalendarButton = () => (
51
56
  <button
52
57
  ref={btnRef}
@@ -80,7 +85,7 @@ export const DatepickerInputs = ({ state }: { state: IDatepickerState }) => {
80
85
  aria-describedby={helptext ? `${id}-helptext` : undefined}
81
86
  aria-invalid={hasError}
82
87
  aria-errormessage={hasError ? `${id}-error` : undefined}
83
- onClick={toggleCalendar}
88
+ onClick={handleInputClick}
84
89
  onKeyDown={handleMultipleKeydown}
85
90
  onFocus={handleFocus}
86
91
  onBlur={handleMultipleBlur}
@@ -115,7 +120,7 @@ export const DatepickerInputs = ({ state }: { state: IDatepickerState }) => {
115
120
  aria-describedby={helptext ? `${id}-helptext` : undefined}
116
121
  aria-invalid={hasError}
117
122
  aria-errormessage={hasError ? `${id}-error` : undefined}
118
- onClick={toggleCalendar}
123
+ onClick={handleInputClick}
119
124
  onKeyDown={handleRangeFromKeydown}
120
125
  onFocus={handleFocus}
121
126
  onBlur={handleRangeBlur}
@@ -138,7 +143,7 @@ export const DatepickerInputs = ({ state }: { state: IDatepickerState }) => {
138
143
  disabled={disabled}
139
144
  aria-label={`${label} ${strings.generic?.to ?? 'Til'}`}
140
145
  aria-invalid={hasError}
141
- onClick={toggleCalendar}
146
+ onClick={handleInputClick}
142
147
  onKeyDown={handleRangeToKeydown}
143
148
  onFocus={handleFocus}
144
149
  onBlur={handleRangeBlur}
@@ -171,7 +176,7 @@ export const DatepickerInputs = ({ state }: { state: IDatepickerState }) => {
171
176
  aria-describedby={helptext ? `${id}-helptext` : undefined}
172
177
  aria-invalid={hasError}
173
178
  aria-errormessage={hasError ? `${id}-error` : undefined}
174
- onClick={toggleCalendar}
179
+ onClick={handleInputClick}
175
180
  onKeyDown={handleSingleKeydown}
176
181
  onFocus={handleFocus}
177
182
  onBlur={undefined}