Skip to content

Commit

Permalink
Merge pull request #119 from solfacil/style/remove-input-arrows
Browse files Browse the repository at this point in the history
feat: Removendo setas do Input (type: Number)
  • Loading branch information
jonyrc committed Jan 24, 2022
2 parents 293d650 + 736beb2 commit d04a6d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/assets/scss/_input-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
&.hasIconVisibility {
@apply pr-8;
}

&.no-arrows[type='number'] {
&::-webkit-inner-spin-button,
&::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
}

.icon {
Expand Down
9 changes: 9 additions & 0 deletions src/components/Input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'is-icon': $slots['icon'],
search: inputType === 'search',
hasIconVisibility: controlVisibility,
'no-arrows': noArrows,
}"
data-testid="input"
:disabled="disabled"
Expand Down Expand Up @@ -164,6 +165,14 @@ export default {
type: Boolean,
default: false,
},
/** Remove arrows of input number
https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-inner-spin-button#changing_the_cursor_in_the_spin_controls
**/
noArrows: {
type: Boolean,
default: false,
},
},
data: (instance) => ({
Expand Down

0 comments on commit d04a6d1

Please sign in to comment.