Skip to content

Commit fd57775

Browse files
committed
Allow use of any trailing material design icon in TextField
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent 7c35e49 commit fd57775

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/NcTextField/NcTextField.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export default {
131131
<template v-if="type !== 'search'" #trailing-button-icon>
132132
<Close v-if="trailingButtonIcon === 'close'" :size="20" />
133133
<ArrowRight v-else-if="trailingButtonIcon === 'arrowRight'" :size="20" />
134+
<!-- @slot Optional material design icon -->
135+
<slot v-else name="trailing-button-icon" />
134136
</template>
135137
</NcInputField>
136138
</template>
@@ -230,15 +232,12 @@ export default {
230232
231233
/**
232234
* Specifies which material design icon should be used for the trailing
233-
* button. Values can be `close` anbd `arrowRight`.
235+
* button. Values can be `close`, `arrowRight`, or any material
236+
* design icon passed into the slot of the same name.
234237
*/
235238
trailingButtonIcon: {
236239
type: String,
237-
default: 'close',
238-
validator: (value) => [
239-
'close',
240-
'arrowRight',
241-
].includes(value),
240+
default: undefined,
242241
},
243242
244243
/**

0 commit comments

Comments
 (0)