Skip to content

Commit

Permalink
chore(a11y): adhere icon button styling & don’t act as a submit button
Browse files Browse the repository at this point in the history
Co-authored-by: Mike van Veenhuijzen <[email protected]>
  • Loading branch information
langemike and langemike authored Apr 11, 2024
1 parent 1f3cf99 commit 4c0a198
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ exports[`<CheckoutForm> > renders and matches snapshot 1`] = `
<button
aria-label="common:back"
class="_iconButton_0fef65 _dialogBackButton_248199"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports[`<Dialog> > renders and matches snapshot 1`] = `
<button
aria-label="close_modal"
class="_iconButton_0fef65 _modalCloseButton_b92d69"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<DialogBackButton> > renders and matches snapshot 1`] = `
<button
aria-label="common:back"
class="_iconButton_0fef65 _dialogBackButton_248199"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ exports[`<EditPasswordForm> > renders and matches snapshot 1`] = `
aria-label="reset.view_password"
aria-pressed="false"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -94,6 +95,7 @@ exports[`<EditPasswordForm> > renders and matches snapshot 1`] = `
aria-label="reset.view_password"
aria-pressed="false"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exports[`<Header /> > renders header 1`] = `
aria-haspopup="true"
aria-label="open_menu"
class="_iconButton_0fef65 _iconButton_f4f7a7"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -51,6 +52,7 @@ exports[`<Header /> > renders header 1`] = `
<button
aria-label="Open search"
class="_iconButton_0fef65 _iconButton_f4f7a7 _actionButton_f4f7a7"
type="button"
>
<svg
aria-hidden="true"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = ButtonHTMLAttributes<HTMLButtonElement> & {

const IconButton: React.FC<Props> = ({ children, onClick, className, ...ariaProps }: Props) => {
return (
<button className={classNames(styles.iconButton, className)} onClick={onClick} {...ariaProps}>
<button className={classNames(styles.iconButton, className)} type="button" onClick={onClick} {...ariaProps}>
{children}
</button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<IconButton> > renders and matches snapshot 1`] = `
<button
aria-label="Icon button"
class="_iconButton_0fef65"
type="button"
>
<svg
viewBox="0 0 24 24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`<LanguageMenu> > renders and matches snapshot 1`] = `
aria-label="language_menu"
class="_iconButton_0fef65"
data-testid="language-menu-button"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ exports[`<LoginForm> > renders and matches snapshot 1`] = `
aria-label="login.view_password"
aria-pressed="false"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`<ModalCloseButton> > renders and matches snapshot 1`] = `
<button
aria-label="close_modal"
class="_iconButton_0fef65 _modalCloseButton_b92d69"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exports[`<PasswordField> > renders and matches snapshot 1`] = `
aria-label="reset.view_password"
aria-pressed="false"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ exports[`<RegistrationForm> > renders and matches snapshot 1`] = `
aria-label="registration.view_password"
aria-pressed="false"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ exports[`<SearchBar> > renders and matches snapshot 1`] = `
<button
aria-label="search_bar.clear_search_label"
class="_iconButton_0fef65 _clearButton_3bb1d7"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`<SideBar /> > renders sideBar closed 1`] = `
<button
aria-label="close_menu"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -65,6 +66,7 @@ exports[`<SideBar /> > renders sideBar opened 1`] = `
<button
aria-label="close_menu"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
}

.control > div {
.control > button {
width: 48px;
height: 48px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ exports[`<Cinema> > renders and matches snapshot 1`] = `
<button
aria-label="common:back"
class="_iconButton_0fef65 _backButton_555f3c"
type="button"
>
<svg
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ exports[`<Layout /> > renders layout 1`] = `
aria-haspopup="true"
aria-label="open_menu"
class="_iconButton_0fef65 _iconButton_f4f7a7"
type="button"
>
<svg
aria-hidden="true"
Expand Down Expand Up @@ -82,6 +83,7 @@ exports[`<Layout /> > renders layout 1`] = `
<button
aria-label="close_menu"
class="_iconButton_0fef65"
type="button"
>
<svg
aria-hidden="true"
Expand Down

0 comments on commit 4c0a198

Please sign in to comment.