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.

Raised styles on Button are applied to wrong View

See original GitHub issue

Description

  1. Explain what you did: When you have a button raised and with some type of spacing styling (margin or padding), the shadow created by the raised prop is attached to the wrong view inside the button.

  2. What you expected to happen The border generated from the raised prop should be in the “colored” button, not in that View that happens to be the Button Implementation wrapper.

  3. What actually happens example:

<Button
            title="button"
            raised
            buttonStyle={{ margin: 16 }}
          />

result: img_43c046e71b79-1

Also please include the version of react-native-elements that you are using. version: 0.19.0

Reproduction Steps and Sample Code

https://snack.expo.io/ryrxN0LVf

Solution

I know how to fix it but I need some guide dealing with snapshots because the fix actually change the snapshots, so the fix did not pass…

I actually update the snapshot tests in my branch’s fork. you can see it here: https://github.com/hhg2288/react-native-elements/commit/c8655012f0b70b3436bd564af0a581cd6c5e0fbf

I test it locally & It works correctly. If soeone can help reviewing this I can create the PR to fix it 😃

UPDATE: PR -> https://github.com/react-native-training/react-native-elements/pull/816

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
horaciohcommented, Jan 14, 2018

awesome!!

I just found that problem in my use case & I wanted to help solving it 😃

hope we get a good solution I can implement & help with the project 😃

0reactions
iRoachiecommented, Jan 28, 2018

Closing as per https://github.com/react-native-training/react-native-elements/pull/816#issuecomment-359210663. If this is still a problem in v1 then ping me to reopen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 Material - mat-button style not being applied in mat ...
I want to create a mat-dialog with a default-style mat-button for closing the dialog. Everything works except the button lacks the Material ...
Read more >
Raised style is not showing · Issue #118 - GitHub
I tried to debug the issue a bit. In chrome I selected the paper-button element with the raised property. I then attempted to...
Read more >
Styling The Good Ol' Button Element - Ahmad Shadeed
First, we need to override the appearance property. It's used to provide a platform-native styling that is based on the user operating system...
Read more >
Styling buttons - Squarespace Help Center
Button style - Choose solid, outline, or raised. For outline, the text automatically displays as either black or white on hover, depending on ......
Read more >
ElevatedButton class - material library - Flutter - Dart API docs
The style of this elevated button can be overridden with its style parameter. The style of all elevated buttons in a subtree can...
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