dotnet / dotnet/wpf

ListBox does not react to "ScrollIntoView" if the last "Items.Add"s were the same.

Open
#9,357 1 comment 0 reactions 0 assignees View on GitHub
:mailbox_with_no_mail: waiting-author-feedback
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/ListBox-does-not-react-to-ScrollIntoVie/10504143)._

---
[severity:It's more difficult to complete my work]
* Create ListBox "LB"
* create one button with lines:
LB.Items.Add("SameText");
LB.ScrollIntoView(LB_Status.Items.GetItemAt(LB_Status.Items.Count - 1));

* create another button with lines:
var rand = new Random();
LB.Items.Add(rand.Next(1000).ToString());
LB.ScrollIntoView(LB_Status.Items.GetItemAt(LB_Status.Items.Count - 1));

->Listbox will scroll to last item only on button 2 (random item values)

.net 8
Preview 5

---
### Original Comments

#### Alison Jin [MSFT] on 11/1/2023, 08:58 AM:

(private comment, text removed)
#### Person (2023-10-31 15:34:10Z) on 11/1/2023, 10:43 PM:

(private comment, text removed)
#### Feedback Bot on 11/6/2023, 00:32 PM:

(private comment, text removed)
#### Feedback Bot on 2/5/2024, 00:15 PM:

(private comment, text removed)

---
### Original Solutions
(no solutions)

----
### Repro
[WPF_Listbox.zip](https://github.com/user-attachments/files/16106897/WPF_Listbox.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.