Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox tab completion fails under some scenarios #3685

Open
tznind opened this issue Aug 22, 2024 · 0 comments
Open

ComboBox tab completion fails under some scenarios #3685

tznind opened this issue Aug 22, 2024 · 0 comments
Labels
bug v2 For discussions, issues, etc... relavant for v2

Comments

@tznind
Copy link
Collaborator

tznind commented Aug 22, 2024

Describe the bug

Tab completion in ComboBox works the first time you type something in but fails when changing and Tab completing the second time.

To Reproduce
Using the below code

  • Tab into the ComboBox
  • Type "Le"
  • Press Down to select "Left", it auto completes as expected
  • Hit Tab (to move focus to Label)
  • ComboBox completes to "Left" as expected
  • Hit Tab (to refocus the ComboBox)
  • Delete the text and type "Ri"
  • Press Down to select "Right", it auto completes as expected
  • Hit Tab
  • See error

The expected behaviour is for the text to behave as before and leave "Right" selected in combo box

Actual behaviour is that it resets to "Left"

tab-complete-right-fail

using System.Collections.ObjectModel;
using Terminal.Gui;

namespace delmev2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Application.Init();


            var d = new Dialog()
            {
                Width = 50,
                Height = 10
            };

            var lbl = new Label()
            {
                Text = "Side:",
                Width = 10,

                // The thing we want
                CanFocus = true,
            };
            d.Add(lbl);

            var dropdown = new ComboBox()
            {
                X = Pos.Right(lbl),
                Width = 10,
                Height = 5
                
            };

            dropdown.SetSource(new ObservableCollection<Side>(Enum.GetValues(typeof(Side)).Cast<Side>()));
            d.Add(dropdown);

            Application.Run(d);
            Application.Shutdown();

        }
    }
}
@tznind tznind added bug v2 For discussions, issues, etc... relavant for v2 labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v2 For discussions, issues, etc... relavant for v2
Projects
Status: No status
Development

No branches or pull requests

1 participant