You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening a Modal that includes a ScrollView or a VirtualList spanning multiple pages, the ScrollView automatically scrolls to the first element. This issue arises from the modal focus trap logic, even when the initialScrollIndex is set to a value other than the index of the first element.
To illustrate this issue, please refer to the steps and accompanying video below:
The intended page is initially displayed.
The modal's focus trap initialization logic triggers focus on the first element inside the ScrollView.
The focused element automatically scrolls itself into view.
Screen.Recording.2023-06-23.at.14.34.34.mov
This issue does not occur in Chrome. It happens only on Safari and mobile Safari.
Expected behavior
Opening a Modal containing a scroll view should not alter the initial scroll position
Steps to reproduce
Environment:
OS: macOS Ventura 13.4
Browser: Safari Version 16.5 (18615.2.9.11.4)
Steps to reproduce:
Implement a FlatList inside a Modal.
Ensure the FlatList's content is substantial enough to span across multiple pages.
Set the initialScrollIndex to a value representing an item located in the middle of the list.
Open the Modal.
Expected outcome:
The modal displays the item at the index specified by initialScrollIndex.
Actual outcome:
The modal automatically scrolls to the first item of the list, disregarding the specified initialScrollIndex.
Is there any information about updates being made to the Modal Focus Trap logic, or other potential solutions that might resolve the issue in question, such as #2483?
I'm hesitant to begin working on a fix that alters the Modal Focus Trap logic without knowing if changes are already planned or underway.
Is there an existing issue for this?
Describe the issue
When opening a Modal that includes a ScrollView or a VirtualList spanning multiple pages, the ScrollView automatically scrolls to the first element. This issue arises from the modal focus trap logic, even when the
initialScrollIndex
is set to a value other than the index of the first element.To illustrate this issue, please refer to the steps and accompanying video below:
Screen.Recording.2023-06-23.at.14.34.34.mov
This issue does not occur in Chrome. It happens only on Safari and mobile Safari.
Expected behavior
Opening a Modal containing a scroll view should not alter the initial scroll position
Steps to reproduce
Environment:
Steps to reproduce:
initialScrollIndex
to a value representing an item located in the middle of the list.Expected outcome:
initialScrollIndex
.Actual outcome:
initialScrollIndex
.Test case
https://codesandbox.io/s/upbeat-lalande-pjq75x
Additional comments
The issue does not seem to occur if we use Chrome
The text was updated successfully, but these errors were encountered: