{"action":"opened","issue":{"url":"https://api.github.com/repos/react-bootstrap/react-overlays/issues/135","repository_url":"https://api.github.com/repos/react-bootstrap/react-overlays","labels_url":"https://api.github.com/repos/react-bootstrap/react-overlays/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/react-bootstrap/react-overlays/issues/135/comments","events_url":"https://api.github.com/repos/react-bootstrap/react-overlays/issues/135/events","html_url":"https://github.com/react-bootstrap/react-overlays/issues/135","id":196537814,"number":135,"title":"margin on Position target causes incorrect positioning","user":{"login":"timothykang","id":3269853,"avatar_url":"https://avatars.githubusercontent.com/u/3269853?v=3","gravatar_id":"","url":"https://api.github.com/users/timothykang","html_url":"https://github.com/timothykang","followers_url":"https://api.github.com/users/timothykang/followers","following_url":"https://api.github.com/users/timothykang/following{/other_user}","gists_url":"https://api.github.com/users/timothykang/gists{/gist_id}","starred_url":"https://api.github.com/users/timothykang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothykang/subscriptions","organizations_url":"https://api.github.com/users/timothykang/orgs","repos_url":"https://api.github.com/users/timothykang/repos","events_url":"https://api.github.com/users/timothykang/events{/privacy}","received_events_url":"https://api.github.com/users/timothykang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-19T22:32:21Z","updated_at":"2016-12-19T22:32:21Z","closed_at":null,"body":"This issue can be reproduced directly on [the `Position` example](https://react-bootstrap.github.io/react-overlays/#position), by changing\r\n```jsx\r\n<Button bsStyle='primary' ref='target' onClick={this.toggle}>\r\n```\r\nto\r\n```jsx\r\n<Button bsStyle='primary' ref='target' onClick={this.toggle} style={{marginLeft: '10px'}}>\r\n```\r\n\r\n\r\nThis issue looks to be caused by the usage of `dom-helpers/query/position` (in `utils/calculatePosition.js`). `dom-helpers/query/position` mimics [jQuery.position(), which does not account for margins](https://api.jquery.com/position/).\r\n\r\nI believe the correct course of action is to account for margins (i.e. add them to the offsets) in `utils/calculatePosition.js`. If the maintainers agree I'd be happy submit a PR.\r\n\r\n"}}
{"actor":{"display_login":"timothykang"}}