(element)
| 73 | } |
| 74 | |
| 75 | export function focus(element) { |
| 76 | const prevFocus = document.activeElement |
| 77 | if (prevFocus === element) { |
| 78 | return |
| 79 | } |
| 80 | |
| 81 | element.focus() |
| 82 | triggerFocusEvent(element) |
| 83 | |
| 84 | if (prevFocus) { |
| 85 | const blurEvent = new Event('blur', {bubbles: true, cancelable: true}); |
| 86 | prevFocus.dispatchEvent(blurEvent); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | export function setChipListValue(chipListComponent, value) { |
| 91 | const chipList = M.Chips.getInstance($(chipListComponent.$el).find('.chips').get(0)); |
no test coverage detected