HandyOrg / HandyOrg/HandyControl

Can't clear the autocomplete textbox

Open
#1,366 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
7.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Trying to programmatically clear the autocomplete textbox using:
firstNameText.Text = string.Empty;
or
firstNameText.Text = ""
and also
firstNameText.PreviewTextInput -= firstNameText_Preview;
firstNameText.Text = string.Empty;
firstNameText.InvalidateVisual();
firstNameText.PreviewTextInput += firstNameText_Preview;

but the autocompletetextbox won't clear.

Steps to reproduce the bug

Create an autocompletetextbox
Bind that autocompletetextbox's itemsource to an observablecollection.
Create a button
Attach a function to that button that clears the autocompletetextbox.Text.

Pick a selection from the dropdown.
Press the button you created.

Expected behavior

I expected the text to clear.

Screenshots

No response

NuGet package version

HandyControl 3.4.0

IDE

Visual Studio 2019

Framework type

No response

Windows version

May 2021 Update (19043)

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the AutoCompleteTextBox implementation and reproduce the issue with an ItemsSource, a selected dropdown item, and a button that assigns an empty string to Text. Trace how the displayed value is updated after selection; done means clearing Text removes the visible text in that sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.