Skip to content

Commit

Permalink
Allow use of any trailing material design icon in TextField
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Sep 30, 2022
1 parent 7c35e49 commit fd57775
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/NcTextField/NcTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export default {
<template v-if="type !== 'search'" #trailing-button-icon>
<Close v-if="trailingButtonIcon === 'close'" :size="20" />
<ArrowRight v-else-if="trailingButtonIcon === 'arrowRight'" :size="20" />
<!-- @slot Optional material design icon -->
<slot v-else name="trailing-button-icon" />
</template>
</NcInputField>
</template>
Expand Down Expand Up @@ -230,15 +232,12 @@ export default {
/**
* Specifies which material design icon should be used for the trailing
* button. Values can be `close` anbd `arrowRight`.
* button. Values can be `close`, `arrowRight`, or any material
* design icon passed into the slot of the same name.
*/
trailingButtonIcon: {
type: String,
default: 'close',
validator: (value) => [
'close',
'arrowRight',
].includes(value),
default: undefined,
},
/**
Expand Down

0 comments on commit fd57775

Please sign in to comment.