question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to change color of confirm button

See original GitHub issue

Issue

I cannot change the color of the confirm button using the custom styles. The color is set under btnTextText. I tried changing the style for that, but it doesn’t work. My custom styling for dateInput works for me. I’ve tried changing color for all the other btn styles, but nothing is working. What property should i be changing?

Code

<DatePicker
            date={this.state.date}
            onDateChange={this.setDate}
            confirmBtnText="Confirm"
            cancelBtnText="Cancel"
            iconComponent={calIcon}
            customStyles={{
              btnTextText: {
                color: color.navBarIcon,
                fontSize:40,
              },
              dateInput: {
                borderWidth: 0,
                alignItems: 'left'
              }
            }}
          />

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:10

github_iconTop GitHub Comments

4reactions
valaruncommented, Feb 15, 2018

You can change the color of the confirm button by setting the color of btnTextConfirm inside customStyles.

Example:

<DatePicker
            date={this.state.date}
            onDateChange={this.setDate}
            confirmBtnText="Confirm"
            cancelBtnText="Cancel"
            iconComponent={calIcon}
            customStyles={{
              btnTextText: {
                color: color.navBarIcon,
                fontSize:40,
              },
              dateInput: {
                borderWidth: 0,
                alignItems: 'left'
              },
              btnTextConfirm: {
                color: 'pink'                 <-------
              }
            }}
          />
1reaction
meirav-scommented, Mar 31, 2022

@fkrajcar it’s not working to me. any idea how can I change the confirm & cancel buttons text color? (for android) its urgent to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to change the button color of confirm box in Bootbox
In Bootbox, I am unable to change the button color of confiem box, please help me out. here is my code: bootbox.confirm('This action...
Read more >
Put a colour to ok button in a confirm message - ServiceNow
After running a confirm is coming with two buttons "OK", "Cancel" default colour of that ok button is blue i want to change...
Read more >
Solved: Help Cannot Change Color on Buttons - Qlik Community
When I create a Button the color of the background is gray and the color of the font is gray. I have tried...
Read more >
Button color won't change - HTML - Codecademy Forums
https://www.codecademy.com/en/courses/web-ext/projects/html-css-prj_bestbite?link_content_target=interstitial_project I'm unable to match ...
Read more >
Unable to change the button color of confirm box in Bootbox
In Bootbox, I am unable to change the button color of confiem box, please help me out. here is my code: bootbox.confirm('This action...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found