Skip to content

Commit

Permalink
[EuiSuperDatePicker] Fix usage within <form>s (#7504)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Feb 6, 2024
1 parent 70634a0 commit c7f4974
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/upcoming/7504.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed `EuiSuperDatePicker` submit bug when used within `<form>` elements
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exports[`EuiSuperDatePicker props accepts data-test-subj and passes to EuiFormCo
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -109,6 +110,7 @@ exports[`EuiSuperDatePicker props compressed is rendered 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -241,6 +243,7 @@ exports[`EuiSuperDatePicker props isDisabled config object 1`] = `
class="euiSuperDatePicker__prettyFormat euiSuperDatePicker__prettyFormat--disabled"
data-test-subj="superDatePickerShowDatesButton"
disabled=""
type="button"
>
<span
data-test-subj="customDisabledDisplay"
Expand Down Expand Up @@ -293,6 +296,7 @@ exports[`EuiSuperDatePicker props isDisabled true 1`] = `
class="euiSuperDatePicker__prettyFormat euiSuperDatePicker__prettyFormat--disabled"
data-test-subj="superDatePickerShowDatesButton"
disabled=""
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -423,6 +427,7 @@ exports[`EuiSuperDatePicker props showUpdateButton can be false 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -471,6 +476,7 @@ exports[`EuiSuperDatePicker props showUpdateButton can be iconOnly 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -542,6 +548,7 @@ exports[`EuiSuperDatePicker props width can be auto 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -610,6 +617,7 @@ exports[`EuiSuperDatePicker props width can be full 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -679,6 +687,7 @@ exports[`EuiSuperDatePicker renders 1`] = `
<button
class="euiSuperDatePicker__prettyFormat"
data-test-subj="superDatePickerShowDatesButton"
type="button"
>
Last 15 minutes
</button>
Expand Down Expand Up @@ -755,6 +764,7 @@ exports[`EuiSuperDatePicker renders an EuiDatePickerRange 1`] = `
class="euiDatePopoverButton euiDatePopoverButton--start euiDatePopoverButton-isSelected"
data-test-subj="superDatePickerstartDatePopoverButton"
title="~ 15 minutes ago"
type="button"
>
~ 15 minutes ago
</button>
Expand All @@ -775,6 +785,7 @@ exports[`EuiSuperDatePicker renders an EuiDatePickerRange 1`] = `
class="euiDatePopoverButton euiDatePopoverButton--end"
data-test-subj="superDatePickerendDatePopoverButton"
title="now"
type="button"
>
now
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`EuiSuperUpdateButton renders 1`] = `
class="euiDatePopoverButton euiDatePopoverButton--start"
data-test-subj="superDatePickerstartDatePopoverButton"
title=""
type="button"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const EuiDatePopoverButton: FunctionComponent<

const button = (
<button
type="button"
onClick={onPopoverToggle}
className={classes}
title={title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ export class EuiSuperDatePickerInternal extends Component<
return (
<EuiFormControlLayout {...formControlLayoutProps}>
<button
type="button"
className={classNames('euiSuperDatePicker__prettyFormat', {
'euiSuperDatePicker__prettyFormat--disabled': isDisabled,
})}
Expand Down

0 comments on commit c7f4974

Please sign in to comment.