Skip to content
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

targetOffset seems not works in the way i think #232

Open
luqingxuan opened this issue Dec 26, 2016 · 0 comments
Open

targetOffset seems not works in the way i think #232

luqingxuan opened this issue Dec 26, 2016 · 0 comments
Labels

Comments

@luqingxuan
Copy link

i have the config bellow, $input is a input element, $picker is a div element, as popover layer

target: $input,
targetAttachment: 'bottom left',
 targetOffset: '10px 0',
element: $picker,
attachment: 'top left', 
constraints: [{
         to: 'window',
         attachment: 'together'
}]

u can see, $input & $picker has vertical offset 10px, when $picker show bellow $input, it works well,
but when scroll down browser, $picker flips, and show up $input, the 10px calculation seems wrong, the gap between $input & $picker seems -10px, not 10px,

maybe u can see this example, it uses tether for react-datepicker.
https://hacker0x01.github.io/react-datepicker/
datepicker plugin works well, because the author make js config:
targetOffset: '10px 0'

and also css:
.react-datepicker__tether-element-attached-bottom.react-datepicker__tether-element {
margin-top: -20px;
}

just multi 2....
so i think if he config targetOffset 20px, maybe he must writes margin-top: -40px,

btw: please forget my poor english.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants