-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
icon in button is not centered #901
Comments
Hey there! When the The icon has a default style of However that default style is overrided by the Which means we can override it like this! <Button icon={{ name: "home", style: { marginRight: 0 } }} buttonStyle={{ width: 50 }} /> Takes breath: |
Closing this as it seems to be resolved (thanks @iRoachie) |
Fixes (react-native-elements#639 , react-native-elements#771 , react-native-elements#901) by not adding redundant `<Text/>` component with `styles.title.padding = 8` if title is empty.
@xavier-villelegier it seems |
* Remove Text from Button if title is empty Fixes (#639 , #771 , #901) by not adding redundant `<Text/>` component with `styles.title.padding = 8` if title is empty. * Handle empty string in title prop of Button Without this change, `title={null}` works correctly, but `title=""` throws an exception described and resolved in following issue: facebook/react-native#13243 (comment) This commit makes handles both `title={null}` and `title=""`.
This appears to be yet another issue that was "fixed" that isn't fixed. This is my first experience with the library and so far it seems many fundamental elements are missing or broken. I'm trying to make a round button with an icon. You have round icons, which apparently can be made into buttons (that's not confusing) but adding an icon to a button results in the icon being, seemingly permanently so, stuck on the left side. There's nothing in the docs to indicate how to make a round icon, so it's unclear what exactly can be done with props to do this, though there's about 15 examples at the top of the page. You might have fewer github issues if your docs were more complete. |
@methodbox The issue is closed because the user filed an issue with v19.0.1 as the version they were using. There's no "fix" for his issue in a subsequent stable release so the resulting method was given as a solution for his particular version. The last stable release was v19.0.1. However, since then, we have had 6 beta versions with a lot of changes - the latest one being 1.0.0-beta7. Docs are an ongoing process and this library originally released a long time ago as being one of the first react native UI libraries on launch. The Button docs are made very less confusing in the next version, and I'd love if you have any constructive feedback that could improve the library. All changes for the next release are on the |
v0.19.0
1. Explain what you did
2. What you expected to happen
According to the docs, without text the button should display centered.
https://github.com/react-native-training/react-native-elements/blob/v0.19.0/docs/API/buttons.md
"leftIcon or icon"
"displays a centered icon (when no text) or to the left (with text). (can be used along with rightIcon as well)"
3. What actually happens
The button is shifted left of center.
The text was updated successfully, but these errors were encountered: