Skip to content

picker list support custom backgroundColor #3214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

adids1221
Copy link
Contributor

Description

Picker - PickerItemList support custom backgroundColor.

Changelog

Picker - PickerItemList support custom backgroundColor.

Additional info

Issue #3111

@nitzanyiz
Copy link
Collaborator

@adids1221 Why don't we let the user change the background color through customPickerProps.modalProps.overlayBackgroundColor (Like the user mentioned). (Btw it seems to be breaking the modal behavior when you pass it (any modalProps)

@nitzanyiz nitzanyiz assigned adids1221 and unassigned nitzanyiz Aug 27, 2024
@adids1221
Copy link
Contributor Author

adids1221 commented Aug 27, 2024

@adids1221 Why don't we let the user change the background color through customPickerProps.modalProps.overlayBackgroundColor (Like the user mentioned). (Btw it seems to be breaking the modal behavior when you pass it (any modalProps).

Ok, in the issue the user mentioned that he can't change the modal bg color since the PickerItemList has bgdefault token.
The issue is coming from the picker item list, the custom overlay bg color will be seen only when the modal have overlay background which is only Modal mode.

snippet code:

          <Picker
            placeholder="Favorite Language"
            value={this.state.language}
            onChange={item => this.setState({language: item})}
            // customPickerProps={{modalProps: {overlayBackgroundColor: Colors.$backgroundWarningLight}}}
            backgroundColor={Colors.$backgroundWarningLight}
            topBarProps={{title: 'Languages'}}
            items={longOptions}
          />

Let's sync about it.

@adids1221
Copy link
Contributor Author

Closing the PR, all the issue was only the bg color in the PickerItemList.

@adids1221 adids1221 closed this Aug 27, 2024
@adids1221 adids1221 deleted the feat/picker_list_backgroundColor branch August 27, 2024 12:07
@theobouwman
Copy link

@adids1221 where can you set it in the PickerItemList?

@adids1221
Copy link
Contributor Author

@adids1221 where can you set it in the PickerItemList?

Hi @theobouwman (related PR),
You can pass customPickerProps={{modalProps: {overlayBackgroundColor: 'red'}}} to the Picker and override the PickerItemList overlayBackgroundColor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants