-
Notifications
You must be signed in to change notification settings - Fork 721
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
Fix/hint position #3469
base: master
Are you sure you want to change the base?
Fix/hint position #3469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ethanshar, Why did we fix this only for short messages?
Co-authored-by: Nitzan Yizhar <[email protected]>
@nitzanyiz Two reasons
|
I think most of the cases where we saw this bug is where they wanted to use the hint without a side tip and the target was on the sides of the screen. Currently after your fix, for short messages, it is fixed but for a little longer messages it not and it even get out of the screen. Not sure what is better 😅 import React, {Component} from 'react';
import {View, Text, Card, TextField, Button, Hint} from 'react-native-ui-lib';
export default class PlaygroundScreen extends Component {
render() {
return (
<View bg-grey80 flex padding-20>
<View style={{alignSelf: 'flex-start'}} bg-red30>
<Hint message={'This is a short message'} visible useSideTip={false}>
<Text>Hello</Text>
</Hint>
</View>
</View>
);
}
} |
Ok, we'll have to improve the logic. The assumption I did for short message is not good enough, I'll check if we can have a better solution The problem is that your use case should have worked ok, maybe it's a different bug |
@nitzanyiz After something digging, what you are showing is totally different issue Back to the issue I have fixed, I see it requires the user pass useSideTip={false} and it's not trivial so Im trying to fix it |
@nitzanyiz @Inbal-Tish
I think these fixes solve most of the issues, for some cases where users do "stupid" things we can always fix but we can guide them which props to pass and how (useSideTip, edgeMargins, etc..) |
This simple example doesn't look good: |
Yes, it also happens in |
@Inbal-Tish @nitzanyiz Unfortunately, there's a root issue with this component which we need to consider refactoring
The latter is a more complex scenario because we have scenarios where the hint's target is deeply nested which force us to do all kind of calculations to make the hint appear in the right location. Anyway, for now, I believe this PR fix most of issues users complained on so we can merge it (unless you find other regression issues) |
Description
There's a dedicate method that calculates the offset for the hint message
Changelog
Fix Hint positioning when target is pushed by another element
Additional info