-
Notifications
You must be signed in to change notification settings - Fork 208
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
popup arrowStyle css property "left" is been overridden #36
Comments
HI, @yashhy good remark, |
Sure will do 👍 |
Hey @yjose, along with overriding arrow left, arrow top, content left and top can also be overridden? So with that said, The current code for
and code for
Let me know your thoughts. |
Hi @yashhy, for the arrow, I think the best way is to customize position, we can use the arrowStyle position but must be related to the current position already calculated by the |
@yashhy any update here or I can take the lead to fix it |
@yjose sorry man, was busy with other things. I was opening up a PR but it threw me this Pushing to https://github.com/yjose/reactjs-popup.git |
Hi @yashhy , you need to fork the repo first ( GitHub top buttons ), then you can update and push code to your forked repo and then you can open a PR from your GitHub repo. |
…idden - arrowStyle.top and arrowStyle.left css property will now be respected for setting the arrow style
…left-is-been-overridden fix issue #36 popup arrowStyle css property "left" is been overridden
While trying to custom
arrowStyle = { left: 20px }
has no effect.CodeSandbox link where the
left: 50px
is ignoredhttps://codesandbox.io/s/pmp848njwx
I see its getting overridden by this line of code here.
The Issue :
I set the
offsetX
props to move the popup content right (because that's my requirment) and now the arrow also moves right. So to centre align the arrow I usearrowStyle
prop set theleft
property and that's been overridden.Without OffsetX:
Without OffsetX:
Suggestions:
left
property is explicitly set usingarrowStyle
, take the property from there without calculatingarrowLeft
arrowLeft
with respect tooffsetX
props. LikearrowLeft = ((triggerBounding.width / 2) - offsetX) + "px";
. This would be bit buggy if the offsetX is set to very large values.offsetArrowX
to specify the arrow left explicitly.First approach is bit more cleaner and explicit.
Version
1.2.0
The text was updated successfully, but these errors were encountered: