Skip to content

Commit

Permalink
docs(kbutton): add comment on stripping falsy disabled attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder committed Jul 14, 2022
1 parent 4bfd8d5 commit dd08abc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/KButton/KButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export default defineComponent({
})
/**
* Strips falsy `disabled` attribute, so it does not fall onto native <a> elements
* Strips falsy `disabled` attribute, so it does not fall onto native <a> elements.
* Vue 3 no longer removes attribute if the value is boolean false. Instead, it's set as attr="false".
* So for <KButton :disabled="false" to="SOME_URL">, the rendered <a> element will have `disabled="false"`,
* which is greyed out and cannot be interacted with.
*/
const strippedAttrs = computed((): typeof attrs => {
const { disabled, ...restAttrs } = attrs
Expand Down

0 comments on commit dd08abc

Please sign in to comment.