Closed zhuliminl closed 4 years ago
What do you mean change the arrow position? The position is determined by the button or rect you show the popover from, so you can just change the ref or text to change the position of the arrow. Do you have an example you can show of where the arrow is in the wrong position?
Closing due to inactivity
@SteffeyDev problably something like this And that's what I'm also looking for. I'm using tooltip mode. Is it possible to change the triangle alignment/position?
Ah, I see what you mean. What you can do is pass a Rect
object into the from
prop to specify where on the screen the top of the arrow goes to (if you set width and height to 0 then you can use x an y to control the coordinates of the arrow). You can then use the placement
prop to control which direction the popover opens in. A placement of bottom would make the arrow point up. Does that help?
You can adjust the style of the popover and the arrow using the corresponding style props, which allows you to change color, set border radius, size, etc. In the test app that is linked at the top of the readme, I have examples of different size arrows, different corner radius, and different colors.
Actually I'm using placement="top"
but the arrow is horizontally align to the center of the popover. I'd like to align it to the start of the popover like this:
Gotcha. I would consider adding an offset into a future version to make this easier. Can't say when I'll have time but I welcome pull requests as always.
Until then, you'll have to calculate the rect of the button manually and then pass a Rect to the from
prop. You can look into the source code to see how I calculate the rect and then use that to calculate the rect, then just shorten the width of the rect to shift the popover source to the left.
@IkaroAlef I was working on another feature and decided to just knock this out. Check out the new arrowShift
prop and let me know if it satisfies your needs. I'm also curious if the documentation on it makes sense or if it needs more clarification.
It's perfect! Thank you very much. But is there a way to fix the arrow instead of a multiplier? I tried a value of -0.5 but it becomes relative
I'm trying to align the arrow with the icons (still working on it)
Awesome! Good to hear :)
Oh sorry, I edited my comment.
What is the source view of the popover? If you set the source view to be the icon, the arrow will align with the icon.
I tried, but the popover won't show up. I'm using the Showing popover from a reference to an element way and set the ref to the icon, but the popover won't show up.
How can I change arrow position ? this is so important for my UI