Search code examples
powerappspowerapps-canvaspowerapps-selected-items

How to set the Fill property of a combobox if the drop-down is selected?


Can anyone help me to change the Fill property of a ComboBox when the ComboBox is selected by the user? Currently, when the drop-down is clicked the values to be selected are transparent across the other values in the gallery. I'd like to set the fill property to white on drop-down so the selectable options are clearly visible. Thank you!

I've tried to use ".IsSelected" and ".Selected" but to no avail.


Solution

  • You have properties like below for Combo box control in Power Apps:

    • SelectionColor
    • SelectionFill
    • SelectionTagColor
    • SelectionTagFill
    • Fill

    You might want to utilize those properties based on your requirements.

    Here are some Accessibility guidelines for combo box control

    enter image description here

    Documentation: Combo box control in Power Apps


    Anyway, if you want to set color conditionally, you can use formula in this format:

    If(
        IsBlankOrError(dropdownControl.Selected),
        RGBA(0, 0, 0, 1), // Some other color as per your requirements
        RGBA(255, 255, 255, 1) // White
    )
    

    If the value is selected in drop down, it will show the white color else other color you specified.