Skip to content

Commit

Permalink
fix(radio): allow click between input and label
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbertrand committed May 3, 2024
1 parent 22bd056 commit 3026501
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions addon/components/pix-radio-button.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<div class="pix-radio-button {{@class}}">
<input
type="radio"
id={{this.id}}
class="pix-radio-button__input"
value={{@value}}
...attributes
/>
<PixLabel
@for={{this.id}}
@requiredLabel={{@requiredLabel}}
Expand All @@ -14,6 +7,13 @@
@isDisabled={{@isDisabled}}
@inlineLabel={{true}}
>
<input
type="radio"
id={{this.id}}
class="pix-radio-button__input"
value={{@value}}
...attributes
/>
{{yield to="label"}}
</PixLabel>
</div>
10 changes: 6 additions & 4 deletions addon/styles/_pix-radio-button.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.pix-radio-button {
display: flex;
gap: var(--pix-spacing-3x);
align-items: center;

& + .pix-radio-button {
margin-top: var(--pix-spacing-4x);
}

.pix-label {
display: flex;
gap: var(--pix-spacing-3x);
align-items: center;
}

&__input {
position: relative;
flex-shrink: 0;
Expand Down

0 comments on commit 3026501

Please sign in to comment.