Merge branch 'kp-6927-epic-dates-from-milestone' into 'master'
Add `tabindex` attribute support on Icon component to show BS4 popover on trigger `focus` See merge request gitlab-org/gitlab-ce!21066
This commit is contained in:
commit
bf699ff498
3 changed files with 17 additions and 0 deletions
|
@ -75,6 +75,12 @@ export default {
|
|||
required: false,
|
||||
default: null,
|
||||
},
|
||||
|
||||
tabIndex: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
@ -98,6 +104,7 @@ export default {
|
|||
:height="height"
|
||||
:x="x"
|
||||
:y="y"
|
||||
:tabindex="tabIndex"
|
||||
>
|
||||
<use v-bind="{ 'xlink:href':spriteHref }"/>
|
||||
</svg>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Add 'tabindex' attribute support on Icon component to show BS4 popover on trigger type 'focus'
|
||||
merge_request: 21066
|
||||
author:
|
||||
type: other
|
|
@ -13,6 +13,7 @@ describe('Sprite Icon Component', function () {
|
|||
name: 'commit',
|
||||
size: 32,
|
||||
cssClasses: 'extraclasses',
|
||||
tabIndex: '0',
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -58,5 +59,9 @@ describe('Sprite Icon Component', function () {
|
|||
it('`name` validator should return false for existing icons', () => {
|
||||
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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue