List "Single mode" activates my inactive button

Description

When I have a list in “sinlge mode” and a “inactive” button, the button is actived again when I press another button

What MCU/Processor/Board and compiler are you using?

Simulator

What do you want to achieve?

I want the button to remain inactive when I press other buttons

What have you tried so far?

I have modified the source code of the list to avoid this behaviour, but I don’t know if there is another way, or if this could be merged into the source code

Code to reproduce

In the lv_list.c:

        if(e == btn) {
            lv_btn_set_state(e, LV_BTN_STATE_TGL_REL);
        } else {
                lv_btn_set_state(e, LV_BTN_STATE_REL);
        }

I have added a line to check if it is inactive

        if(e == btn) {
            lv_btn_set_state(e, LV_BTN_STATE_TGL_REL);
        } else {
            if (lv_btn_get_state(e) != LV_BTN_STATE_INA)
                lv_btn_set_state(e, LV_BTN_STATE_REL);
        }

Screenshot and/or video

N/A

Hi,

It’s really an issue and your solution looks good. Could you send a Pull request?

OK, I 'll try to see how it is done. I just started digging into the code and options.

Alex

Great, thank you!
Here is a summary about Pull requests.

Pulled!

Thank you for your indications, and all the effort!

Alex