-
Notifications
You must be signed in to change notification settings - Fork 6
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
MenuItem's text "jumps" at the start #5
Comments
@xKRUTOIx Could you provide simple app, which reproduces this issue? So I can run it and start debugging right away. Something minimalistict, app with screen with one button, on tap on this button menu is showed up. |
@likern Thanks for the answer. |
@xKRUTOIx I have not touched that part of code from original project https://github.com/mxck/react-native-material-menu. It looks like only Text is supported for MenuItem. That's what I found on original page:
MenuItem is just a something rendered within a Text component:
I don't think (haven't work with react-native-svg extensively) it is legible to put svg inside text. |
My suggestion is for now do not consider MenuItem as a required element. Just copy paste it, modify as you want and use instead of MenuItem. |
Ohh...I see, maybe it's better to ask in the original project then. Although I've found this issue where the original project's author said that MenuItem treats vector icons as text, I've tried vector icon instead svg and I had the same glitch : ( Anyway, thanks for the answers! |
@xKRUTOIx It's more about how You can inject string or other Text elements inside Text:
And https://github.com/oblador/react-native-vector-icons components are just standard Text - that's why they are working inside Text. https://github.com/react-native-community/react-native-svg is a native component, implementing SVG. It doesn't based on React Native I think you can ask question in react-native-svg about putting SVG inside Text. |
@likern You were right. I managed to solve this problem, I just used my custom component instead of |
Hello, I've faced a problem: when a menu shows up text jumps a little at the very beginning and it looks ugly on real devices, (here's a demo that shows this visual bug, decrease speed to 0.5). The
MenuItem
is very simple, it has string variable and vector icon.Although, the glitch disappears when I remove either string or icon from MenuItem (demo).
Code of the menu if it helps:
_mainMenu = () => (<Menu ref={(ref) => this.menuRef = ref} style={styles.menuStyles} > <MenuItem textStyle={styles.menuTextStyles} underlayColor={'#2C2B30'} onPress={() => { this.props.editMessage(this.props.message); this._hideMenu(this.menuRef); }}> {strings.edit} <SvgEditMessage /> </MenuItem> <MenuDivider color={'#676570'}/> <MenuItem textStyle={styles.menuTextStyles} underlayColor={'#2C2B30'} onPress={() => { this._hideMenu(this.menuRef); this._showMenu(this.deletionMenuRef, this.messageRef); }}> {strings.delete} <SvgTrashIcon/> </MenuItem> </Menu>);
The text was updated successfully, but these errors were encountered: