Skip to content

combo box auto resets current value #10805

@brianmay

Description

@brianmay

Bug Description

I have this UI:

export component AppWindow inherits Window {
   [...]
    in property<[string]> rooms;
    in property<string> selected_room;
    callback room_changed(string);

   [...]
    ComboBox {
        x: 10px;
        y: 10px;
        width: 200px;
        height: 40px;
        model: root.rooms;
        current-value: root.selected_room;
        selected(selected) => {
            root.screen_reset();
            root.room_changed(selected);
        }
    }
[...]

In my rust code after receiving the room_changed_event I do:

handle.set_rooms(ModelRc::new(VecModel::from(rooms)));
handle.set_selected_room(selected_room.title.into());

This list of rooms in the first call is always the same. Meaning the selected_room is always valid. This is the exact order of the steps.

What happens is that the selected room changes to the new value briefly for 0 to 2 seconds, and then reverts to the default value.

If I comment out the set_rooms call, then everything works fine.

It is like something is running out of order here. I expect the rooms to be set, then it should set the selected room in that order. But it appears to be running in the opposite order. Or something.

Is this expected behavior? It isn't expected by me.... If this can be explained, please do so, and I will close this bug.

I probably can create a simple test/reproduction if required.

Possibly connected to #9620; not sure. In my case writing to current-value works fine. It is writing to both model and current-value that causes the problem.

Environment Details

  • Slint Version: v1.13.1
  • Platform/OS: NixOs 25.11
  • Programming Language: Rust
  • Backend/Renderer: Wayland

Product Impact

No response

Metadata

Metadata

Assignees

Labels

need triagingIssue that the owner of the area still need to triage

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions