Skip to content

Commit 6c59d42

Browse files
authored
fix: various issues (#136)
* Fix Barlist key * add type="button" to all buttons * Datepicker CalendarIcon flex-none * fix SelectBox button spacing * add form to input elem stories * move resize-observer-polyfill tp devDependencies * Update BarList.tsx * Update package-lock.json * Update SelectBox.tsx
1 parent 6a67cf2 commit 6c59d42

File tree

16 files changed

+35
-18
lines changed

16 files changed

+35
-18
lines changed

package-lock.json

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"dependencies": {
2828
"@tippyjs/react": "^4.2.6",
2929
"date-fns": "^2.28.0",
30-
"recharts": "^2.1.13",
31-
"resize-observer-polyfill": "^1.5.1"
30+
"recharts": "^2.1.13"
3231
},
3332
"devDependencies": {
3433
"@babel/core": "^7.17.9",
@@ -59,6 +58,7 @@
5958
"jest": "^27.5.1",
6059
"postcss": "^8.4.12",
6160
"react-dom": "^18.0.0",
61+
"resize-observer-polyfill": "^1.5.1",
6262
"rollup": "^2.70.2",
6363
"rollup-plugin-dts": "^4.2.1",
6464
"rollup-plugin-peer-deps-external": "^2.2.4",

src/components/input-elements/Datepicker/Datepicker.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const Datepicker = ({
165165
) }
166166
>
167167
<button
168+
type="button"
168169
ref={ datePickerRef }
169170
onClick={ () => setShowDatePickerModal(!showDatePickerModal) }
170171
className={ classNames(
@@ -184,7 +185,7 @@ const Datepicker = ({
184185
>
185186
<CalendarIcon
186187
className={ classNames(
187-
'flex-none',
188+
'tr-flex-none',
188189
getColorVariantsFromColorThemeValue(defaultColors.lightText).textColor,
189190
sizing.lg.height,
190191
sizing.lg.width,
@@ -206,6 +207,7 @@ const Datepicker = ({
206207
</button>
207208
{ enableRelativeDates ? (
208209
<button
210+
type="button"
209211
ref={ dropdownRef }
210212
onClick={ () => setShowDropdownModal(!showDropdownModal) }
211213
className={ classNames(
@@ -424,6 +426,7 @@ const Datepicker = ({
424426
{ relativeFilterOptions.map((filterOption) => (
425427
<button
426428
key={ filterOption.value }
429+
type="button"
427430
onClick={ () => {
428431
setSelectedRelativeFilterOption(filterOption.value);
429432
handleRelativeFilterOptionClick(filterOption.value);

src/components/input-elements/Dropdown/Dropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const Dropwdown = ({
7272
) }
7373
>
7474
<button
75+
type="button"
7576
className={ classNames(
7677
'input-elem tr-flex tr-justify-between tr-items-center tr-w-full',
7778
'focus:tr-ring-2 focus:tr-outline-0',

src/components/input-elements/Dropdown/DropdownItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const DropdownItem = ({
2828
const Icon = icon ? icon : null;
2929
return (
3030
<button
31+
type="button"
3132
onClick={() => privateProps!.handleDropdownItemClick(value)}
3233
className={classNames(
3334
'input-elem tr-flex tr-items-center tr-justify-between tr-w-full',

src/components/input-elements/MultiSelectBox/MultiSelectBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const MultiSelectBox = ({
104104
) }
105105
>
106106
<button
107+
type="button"
107108
className={ classNames(
108109
'input-elem tr-flex tr-justify-between tr-items-center tr-w-full',
109110
'focus:tr-ring-2 focus:tr-outline-0',

src/components/input-elements/MultiSelectBox/MultiSelectBoxItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const MultiSelectBoxItem = ({
2727
privateProps,
2828
}: MultiSelectBoxItemProps) => (
2929
<button
30+
type="button"
3031
onClick={ () => privateProps!.handleMultiSelectBoxItemClick(value) }
3132
className={ classNames(
3233
'input-elem tr-flex tr-items-center tr-justify-between tr-w-full',

src/components/input-elements/SelectBox/SelectBox.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ const SelectBox = ({
110110
onClick={ () => setShowModal(!showModal) }
111111
/>
112112
<button
113+
type="button"
113114
className={ classNames(
114-
'input-elem tr-absolute tr-top-1/2 -tr-translate-y-1/2',
115+
'tr-absolute tr-top-1/2 -tr-translate-y-1/2',
116+
'tr-m-0 tr-p-0',
115117
spacing.twoXl.right,
116118
) }
117119
onClick={ () => setShowModal(!showModal) }

src/components/input-elements/SelectBox/SelectBoxItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const SelectBoxItem = ({
2525
const Icon = icon ? icon : null;
2626
return (
2727
<button
28+
type="button"
2829
onClick={() => privateProps!.handleSelectBoxItemClick(value)}
2930
className={classNames(
3031
'input-elem tr-flex tr-items-center tr-justify-between tr-w-full',

src/components/input-elements/Tab/Tab.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const Tab = ({
4242
return(
4343
<li>
4444
<button
45+
type="button"
4546
className={ classNames(
4647
'input-elem tr-flex tr-whitespace-nowrap tr-max-w-xs tr-truncate',
4748
spacing.twoXs.paddingRight,

0 commit comments

Comments
 (0)