Files
houseplan-card/src/help-behavior.ts
T
2026-08-12 21:49:29 +03:00

14 lines
556 B
TypeScript

/** 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;
}