문제

I am new to SPFX and office-ui-fabric-react. I have a dropdownlist with below code and attributes:

<Stack tokens={stackTokens}>
     <Dropdown placeholder="Select an option" label="Select a name" options={this.state.items} styles={dropdownStyles} />
</Stack>

And here is the dropdownStyles:

const dropdownStyles: Partial<IDropdownStyles> = {
  dropdown: { width: 800 },
};

The official document is quite complex for me. Could you show me how to change the background color of selected dropdownlist item?

도움이 되었습니까?

해결책

Try using something like:

const dropdownStyles: Partial<IDropdownStyles> = {
   dropdownItemSelected: { backgroundColor: "red" },
};
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top