Skip to content

Fatal crash using TokenizingTextBox with SelectionMode=None (uwp) #4437

Open
@0xNF

Description

@0xNF

Describe the bug

As the title says:

<tk:TokenizingTextBox  SelectionMode="None" />

and

<tk:TokenizingTextBox  SelectionMode="Single" />

Both of these cause the following failure when pressing backspace:

"System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
  at System.Runtime.InteropServices.WindowsRuntime.IVector`1.Append(T value)
  at System.Runtime.InteropServices.WindowsRuntime.VectorToCollectionAdapter.Add[T](T item)
  at Microsoft.Toolkit.Uwp.UI.Controls.TokenizingTextBox.SelectNewItem(TokenizingTextBoxItem item, Int32 increment, Func`2 testFunc)
  at Microsoft.Toolkit.Uwp.UI.Controls.TokenizingTextBox.SelectPreviousItem(TokenizingTextBoxItem item)
  at "

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

1. Clone this repo: https://github.com/0xNF/TokenizingTextBoxCrash
2. Create a new tag by pressing enter with some text in the Text Box
3. Press backspace a few times with the textbox still focused
4. crash

Expected behavior

Not crashing

Screenshots

No response

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2019

Visual Studio Build Number

Version 16.10.1

Device form factor

Desktop

Nuget packages

Microsoft.Toolkit.Uwp.UI.Controls 7.1.2

Additional context

No response

Help us help you

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛An unexpected issue that highlights incorrect behaviorcontrols 🎛️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions