mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 06:23:23 +00:00
fix(ui): keep helper popups in visual viewport on mobile
Position helper info popups with visualViewport bounds and max size so they stay on screen. Ignore helper triggers in the global icon tooltip handler via data-icon-tooltip-ignore.
This commit is contained in:
@@ -10,6 +10,7 @@ test('helper trigger is a button that stops label activation', function () {
|
||||
->toContain('type="button"')
|
||||
->toContain('@click.prevent.stop')
|
||||
->toContain('aria-label="{{ $label }}"')
|
||||
->toContain('data-icon-tooltip-ignore')
|
||||
->toContain('info-helper-popup')
|
||||
->toContain('name="info-circle"')
|
||||
->toContain('class="size-3.5 text-neutral-400')
|
||||
@@ -78,6 +79,18 @@ test('helper popup prefers a position below its trigger and falls back above', f
|
||||
->toContain('top = triggerRect.top - popupRect.height - padding;');
|
||||
});
|
||||
|
||||
test('helper popup stays within the visual viewport on mobile', function () {
|
||||
$helper = file_get_contents(resource_path('views/components/helper.blade.php'));
|
||||
|
||||
expect($helper)
|
||||
->toContain('window.visualViewport')
|
||||
->toContain('viewport?.offsetLeft')
|
||||
->toContain('viewport?.offsetTop')
|
||||
->toContain('max-width: ${availableWidth}px;')
|
||||
->toContain('max-height: ${availableHeight}px;')
|
||||
->toContain('overflow-y: auto;');
|
||||
});
|
||||
|
||||
test('helper popup supports focus dismissal and tooltip aria relationships', function () {
|
||||
$helper = file_get_contents(resource_path('views/components/helper.blade.php'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user