Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set some <button> elements to type="button" #1764

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- Set `h1 through h6, p` tags font reset based on family, size, and weight ([#1760](https://github.com/elastic/eui/pull/1760))
- Fixed `EuiButton` font size inheritence ([#1760](https://github.com/elastic/eui/pull/1760))
- Updated button elements in `EuiFilePicker`, `EuiFormControlLayoutClearButton`, `EuiFormControlLayoutCustomIcon`, `EuiListGroupItem`, and `EuiSideNavItem` to type=button ([#1764](https://github.com/elastic/eui/pull/1764))

## [`9.5.0`](https://github.com/elastic/eui/tree/v9.5.0)

Expand Down
2 changes: 2 additions & 0 deletions src/components/combo_box/__snapshots__/combo_box.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`EuiComboBox is rendered 1`] = `
aria-label="Open list of options"
class="euiFormControlLayoutCustomIcon euiFormControlLayoutCustomIcon--clickable"
data-test-subj="comboBoxToggleListButton"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -276,6 +277,7 @@ exports[`props options list is rendered 1`] = `
aria-label="Close list of options"
class="euiFormControlLayoutCustomIcon euiFormControlLayoutCustomIcon--clickable"
data-test-subj="comboBoxToggleListButton"
type="button"
>
<svg
aria-hidden="true"
Expand Down
1 change: 1 addition & 0 deletions src/components/form/file_picker/file_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class EuiFilePicker extends Component {
if (compressed) {
clearButton = (
<button
type="button"
aria-label={clearSelectedFiles}
className="euiFilePicker__clearButton"
onClick={this.removeFiles}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ exports[`EuiFormControlLayout props clear onClick is rendered 1`] = `
aria-label="Clear input"
class="euiFormControlLayoutClearButton customClass"
data-test-subj="clearButton"
type="button"
>
<svg
class="euiIcon euiIcon--medium euiFormControlLayoutClearButton__icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const EuiFormControlLayoutClearButton = ({
<EuiI18n token="euiFormControlLayoutClearButton.label" default="Clear input">
{label => (
<button
type="button"
className={classes}
onClick={onClick}
aria-label={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const EuiFormControlLayoutCustomIcon = ({
if (onClick) {
return (
<button
type="button"
onClick={onClick}
className={classes}
ref={iconRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ exports[`EuiListGroupItem props onClick is rendered 1`] = `
>
<button
class="euiListGroupItem__button"
type="button"
>
<span
class="euiListGroupItem__label"
Expand Down Expand Up @@ -254,6 +255,7 @@ exports[`EuiListGroupItem renders a disabled button even if provided an href 1`]
<button
class="euiListGroupItem__button"
disabled=""
type="button"
>
<span
class="euiListGroupItem__label"
Expand All @@ -272,6 +274,7 @@ exports[`EuiListGroupItem renders a disabled button even if provided an href 2`]
<button
class="euiListGroupItem__button"
disabled=""
type="button"
>
<span
class="euiListGroupItem__label"
Expand Down
1 change: 1 addition & 0 deletions src/components/list_group/list_group_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const EuiListGroupItem = ({
} else if ((href && isDisabled) || onClick) {
itemContent = (
<button
type="button"
className="euiListGroupItem__button"
disabled={isDisabled}
onClick={onClick}
Expand Down
1 change: 1 addition & 0 deletions src/components/side_nav/side_nav_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const defaultRenderItem = ({ href, onClick, className, children, ...rest }) => {
if (onClick) {
return (
<button
type="button"
className={className}
onClick={onClick}
role="menuitem"
Expand Down