mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-01 04:09:17 +00:00
@@ -0,0 +1,13 @@
|
||||
/** Pure content gate shared by the component and executable unit tests. */
|
||||
export function helpHasContent(text: unknown, ariaLabel: unknown): boolean {
|
||||
return typeof text === 'string' && text.trim().length > 0
|
||||
&& typeof ariaLabel === 'string' && ariaLabel.trim().length > 0;
|
||||
}
|
||||
|
||||
/** Scrolling the floating help itself must not dismiss it. */
|
||||
export function helpScrollShouldDismiss(
|
||||
pathIsInsideFloatingSurface: boolean,
|
||||
targetIsDialogOrContainsHelp: boolean,
|
||||
): boolean {
|
||||
return !pathIsInsideFloatingSurface && targetIsDialogOrContainsHelp;
|
||||
}
|
||||
Reference in New Issue
Block a user