ComboBox loses my typing in some situations where I think it shouldn't

Hi everyone,

I have noticed that the ComboBox behavior (at least in 2.7 and 2.8) is not what I’d expect, especially when compared to some of the Windows behavior (namely, MS Word’s Save As dialog) and to the wxWidgets (2.6.3) behavior. I have isolated it to 3 scenarios so far, described below and illustrated in the pywinauto code attached.

I’d like to know if this is intended behavior or if it will be changed any time soon.

I’m trying to work around by implementing the behavior in a subclass, but am finding that not all the events I need are exposed.

Scenario #1:

  • type in the box

  • click the button to open the pull-down

  • click the button again to close the pull-down (without selecting anything in the pull-down)

  • your typing is erased

I would expect that the typing is preserved.

Scenario #2:

  • type in the box

  • click the button to open the pull-down

  • click elsewhere (lose focus)

  • your typing is erased

I would expect that the typing is preserved.

Scenario #3:

  • type in the box

  • press the down arrow on the keyboard

  • typing is replaced by the first element in the pull-down

I would expect that the first down arrow opens the pull-down and preserves my typing. Subsequent down arrows will traverse the list, selecting new entries, and erasing my typing.

Note: Notepad.exe’s Save As does not behave this way

thanks for your consideration,

-Damien Macielinski

combobox.py (3.4 KB)

Macielinski, Damien wrote:

Hi everyone,
I have noticed that the ComboBox behavior (at least in 2.7 and 2.8) is not what I'd expect, especially when compared to some of the Windows behavior (namely, MS Word's Save As dialog) and to the wxWidgets (2.6.3) behavior. I have isolated it to 3 scenarios so far, described below and illustrated in the pywinauto code attached.
I'd like to know if this is intended behavior or if it will be changed any time soon.
I'm trying to work around by implementing the behavior in a subclass, but am finding that not all the events I need are exposed.
Scenario #1:
- type in the box
- click the button to open the pull-down
- click the button again to close the pull-down (without selecting anything in the pull-down)
- your typing is erased
I would expect that the typing is preserved.
Scenario #2:
- type in the box
- click the button to open the pull-down
- click elsewhere (lose focus)
- your typing is erased
I would expect that the typing is preserved.

I don't know about these, but they may be part of some changes made a while back to fix some behavioral bugs.

Scenario #3:
- type in the box
- press the down arrow on the keyboard
- typing is replaced by the first element in the pull-down
I would expect that the first down arrow opens the pull-down and preserves my typing.

On Windows F4 is the key for dropping the listbox. The arrow keys cycle the selection without dropping it down.

Note: Notepad.exe's Save As does not behave this way

I expect that the combo in the file dialog is not totally standard.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!