Skip to content

Commit

Permalink
Merge pull request #588 from catho/QTM-786
Browse files Browse the repository at this point in the history
feat(QTM-786): Added "button" type to prevent form submission when opening options list
  • Loading branch information
MarcosViniciusPC authored Oct 2, 2024
2 parents c0af9c5 + a62fd85 commit 160f344
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/DropdownLight/DropdownLight.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ const DropdownLight = ({
required={required}
/>
<Button
type="button"
aria-haspopup="true"
aria-label={isOpen ? 'fechar lista de itens' : 'abrir lista de itens'}
onClick={handleToggleDropdown}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ exports[`<DropdownLight /> should match the snapshots 1`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -315,6 +316,7 @@ exports[`<DropdownLight /> should match the snapshots 2`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -506,6 +508,7 @@ exports[`<DropdownLight /> should match the snapshots 3`] = `
aria-label="abrir lista de itens"
class="c6"
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -685,6 +688,7 @@ exports[`<DropdownLight /> should match the snapshots 4`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -873,6 +877,7 @@ exports[`<DropdownLight /> should match the snapshots 5`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -1046,6 +1051,7 @@ exports[`<DropdownLight /> should match the snapshots 6`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
this is a input placeholder
<svg
Expand Down Expand Up @@ -1215,6 +1221,7 @@ exports[`<DropdownLight /> should match the snapshots 7`] = `
class="c4"
disabled=""
id=""
type="button"
>
Select an option
<svg
Expand Down Expand Up @@ -1383,6 +1390,7 @@ exports[`<DropdownLight /> should match the snapshots 8`] = `
aria-label="abrir lista de itens"
class="c4"
id=""
type="button"
>
Select an option
<svg
Expand Down

0 comments on commit 160f344

Please sign in to comment.