Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not collapse card when on "Search" and "Select"
- Loading branch information
1 parent
1d5225d
commit dd7e141
Showing
4 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { DirectiveOptions } from 'vue'; | ||
|
||
const attributeName = 'data-interactionDoesNotCollapse'; | ||
|
||
export function hasDirective(el: Element): boolean { | ||
if (el.hasAttribute(attributeName)) { | ||
return true; | ||
} | ||
const parent = el.closest(`[${attributeName}]`); | ||
return !!parent; | ||
} | ||
|
||
export const NonCollapsing: DirectiveOptions = { | ||
inserted(el: HTMLElement) { | ||
el.setAttribute(attributeName, ''); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters