Commit f0c60bdc authored by Kushal Pandya's avatar Kushal Pandya

Add `tabindex` attribute support to show BS4 popover on trigger `focus`

parent f996f7e0
...@@ -75,6 +75,12 @@ export default { ...@@ -75,6 +75,12 @@ export default {
required: false, required: false,
default: null, default: null,
}, },
tabIndex: {
type: String,
required: false,
default: null,
},
}, },
computed: { computed: {
...@@ -98,6 +104,7 @@ export default { ...@@ -98,6 +104,7 @@ export default {
:height="height" :height="height"
:x="x" :x="x"
:y="y" :y="y"
:tabindex="tabIndex"
> >
<use v-bind="{ 'xlink:href':spriteHref }"/> <use v-bind="{ 'xlink:href':spriteHref }"/>
</svg> </svg>
......
...@@ -13,6 +13,7 @@ describe('Sprite Icon Component', function () { ...@@ -13,6 +13,7 @@ describe('Sprite Icon Component', function () {
name: 'commit', name: 'commit',
size: 32, size: 32,
cssClasses: 'extraclasses', cssClasses: 'extraclasses',
tabIndex: '0',
}); });
}); });
...@@ -58,5 +59,9 @@ describe('Sprite Icon Component', function () { ...@@ -58,5 +59,9 @@ describe('Sprite Icon Component', function () {
it('`name` validator should return false for existing icons', () => { it('`name` validator should return false for existing icons', () => {
expect(Icon.props.name.validator('commit')).toBe(true); expect(Icon.props.name.validator('commit')).toBe(true);
}); });
it('should contain `tabindex` attribute on svg element when `tabIndex` prop is defined', () => {
expect(icon.$el.getAttribute('tabindex')).toBe('0');
});
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment