Skip to content

[Bug]: При поднятии модалки с автофокусом она прыгает #8472

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

Open
ponchicken opened this issue Apr 16, 2025 · 3 comments

Comments

@ponchicken
Copy link

ponchicken commented Apr 16, 2025

Описание

Если в ModalCard добавить инпут с автофокусом, то при поднятии такой модалки она прыгает вверх

Версия

7.2.0

В каких браузерах воспроизводится проблема?

Safari iOS
В chrome на Macos, например, тоже есть прыжок, но он еле заметен

Шаги воспроизведения

в ModalCard добавить инпут с автофокусом и открыть её на ios

Ожидаемое поведение

No response

Скриншоты

No response

Пример с воспроизведением

https://codesandbox.io/p/sandbox/hungry-roentgen-zwtlkc

2JOGAOq.mp4
@EldarMuhamethanov
Copy link
Contributor

В доке по [ModalCard](https://vkcom.github.io/VKUI/#/ModalPage) есть раздел "Как правильно применять параметр autoFocus?". В общем при использовании autofocus на поле ввода ломается анимация открытия. Поэтому рекомендуется устанавливать фокус вручную после открытия модалки(так уже сделано в примере). Также не понял, зачем в примере у ModalCard используется noFocusToDialog - скорее всего его нужно убрать

@SevereCloud SevereCloud added this to VKUI Apr 17, 2025
@github-project-automation github-project-automation bot moved this to 🗃 Backlog in VKUI Apr 17, 2025
@SevereCloud SevereCloud moved this from 🗃 Backlog to ⛔️ Blocked in VKUI Apr 17, 2025
@ponchicken
Copy link
Author

фокус по onOpened то же самое что и отсутствие noFocusToDialog - оно всё делает фокус на инпуте, но с задержкой. По политикам эппла на ios такое не поднимет клавиатуру, а это нужно при фокусе на поле ввода

@inomdzhon
Copy link
Contributor

фокус по onOpened то же самое что и отсутствие noFocusToDialog - оно всё делает фокус на инпуте, но с задержкой

тем не менее, решает ли это проблему с пригающей модалкой?

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

No branches or pull requests

5 participants