Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clicking in a modal with focused element out of the screen makes the modal jump to said element #15289

Open
gustavocaiano opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@gustavocaiano
Copy link

Package

filament/filament

Package Version

v3.2.132

Laravel Version

v11.5.0

Livewire Version

v3.5.12

PHP Version

PHP 8.3.13

Problem description

On a Modal, if the focused element is not currently on the screen (scrolled out of view) clicking in the modal outside a element triggers a jump to the focused element.
The same behaviour happens when clicking in a Toggle Button , wich makes selecting an option of a toggle impossible if the focused element is out of view.

image
here i have selected the Text Input

image
Having scrolled the Focused TextInput out of view, I will not be able to click in this ToggleButton without jumping to the TextInput

chrome-capture-2025-1-8

Expected behavior

The expected behaviour would be either :

  • Selecting a option would focus the toggle button, not allowing the modal to jump anywhere.
  • making it a option to disable this behaviour of scrollingIntoView when the focused element is not currently seen on screen

Steps to reproduce

  • Go to https://demo.filamentphp.com/shop/products/brands/1/edit
  • Click in the CreateAction "New Product" of the Products Relation Manager
  • Click on the "Name" TextInput
  • Scroll all the way down (zoom window if needed)
  • Click in the modal or outside of the modal (anywhere but a focusable element)

The behaviour seen is the same when i click a ToggleButton

Reproduction repository (issue will be closed if this is not valid)

https://github.com/filamentphp/demo

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant