Skip to content

Commit 3c8d737

Browse files
Add tooltip directive to single action
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
1 parent 9567c88 commit 3c8d737

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/Actions/Actions.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,23 @@ export default {
808808
*/
809809
if (this.isValidSingleAction && !this.forceMenu) {
810810
console.debug('render single action')
811-
const icon = actions[0]?.data?.scopedSlots?.icon()?.[0]
811+
const firstAction = actions[0]
812+
const icon = firstAction?.data?.scopedSlots?.icon()?.[0]
812813
return h('ButtonVue',
813814
{
814815
class: 'action-item action-item--single',
815816
props: {
816817
type: 'tertiary',
817818
disabled: this.isDisabled,
818819
},
820+
directives: [{
821+
name: 'tooltip',
822+
value: firstAction?.componentOptions?.children?.[0]?.text,
823+
modifiers: {
824+
auto: true,
825+
},
826+
827+
}]
819828
},
820829
[
821830
h('template', { slot: 'icon' }, [ icon ]),

0 commit comments

Comments
 (0)