adobe / adobe/react-spectrum

ComboBox scroll page to top

Open
#3,776 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

# 🐛 Bug Report
When the ComboBox component has some offset at top and items are selected several times, page starts to self scroll to top.

https://user-images.githubusercontent.com/56834937/203146309-7fcbf85c-2096-47a5-9022-d93b56339d6b.mov

## 🤔 Expected Behavior
Page should not self scroll.

## 😯 Current Behavior
Page starts to self scroll to top.

## 💁 Possible Solution
```css
body {
overflow-anchor: none;
}

```
seems to fix issue.

## 🔦 Context

## 💻 Code Sample
https://codesandbox.io/s/frosty-bird-1vn3cq?file=/src/App.tsx

## 🌍 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| react-spectrum |
| Browser |
| Operating System |

## 🧢 Your Company/Team

## 🕷 Tracking Issue (optional)

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and the ComboBox component behavior described in the issue. Reproduce repeated selections with the component offset from the top, then inspect the relevant ComboBox entry point and the proposed overflow-anchor behavior. Done means selecting items repeatedly no longer scrolls the page to the top.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.