{"action":"opened","issue":{"url":"https://api.github.com/repos/FezVrasta/react-popper/issues/248","repository_url":"https://api.github.com/repos/FezVrasta/react-popper","labels_url":"https://api.github.com/repos/FezVrasta/react-popper/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/FezVrasta/react-popper/issues/248/comments","events_url":"https://api.github.com/repos/FezVrasta/react-popper/issues/248/events","html_url":"https://github.com/FezVrasta/react-popper/issues/248","id":384299232,"node_id":"MDU6SXNzdWUzODQyOTkyMzI=","number":248,"title":"When `referenceElement` prop is set to `undefined`, `referenceProps.ref` no longer works.","user":{"login":"HHogg","id":7130591,"node_id":"MDQ6VXNlcjcxMzA1OTE=","avatar_url":"https://avatars0.githubusercontent.com/u/7130591?v=4","gravatar_id":"","url":"https://api.github.com/users/HHogg","html_url":"https://github.com/HHogg","followers_url":"https://api.github.com/users/HHogg/followers","following_url":"https://api.github.com/users/HHogg/following{/other_user}","gists_url":"https://api.github.com/users/HHogg/gists{/gist_id}","starred_url":"https://api.github.com/users/HHogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HHogg/subscriptions","organizations_url":"https://api.github.com/users/HHogg/orgs","repos_url":"https://api.github.com/users/HHogg/repos","events_url":"https://api.github.com/users/HHogg/events{/privacy}","received_events_url":"https://api.github.com/users/HHogg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-26T12:01:32Z","updated_at":"2018-11-26T12:01:32Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nThanks for your interest in contributing to react-popper!  \r\nDo you have any generic question about the library? Find us on Spectrum!\r\n\r\nhttps://spectrum.chat/popper-js/react-popper\r\n\r\nDo you want to report a bug?\r\nPlease, make sure to fill all the sections of the template before submitting any issue. \r\n\r\nIssues without the required informations will be closed.\r\nDo not delete this template or it will be closed!\r\n\r\nIf your issue is a feature request please feel free to delete the template and describe it.  \r\n\r\nWant your issue to be fixed earlier? Create a PR that introduces a CI test that fails\r\nbecause of the bug you found!\r\n-->\r\n\r\n### Reproduction demo\r\n\r\n<!--\r\nFork and/or modify this CodePen/CodeSandbox template to allow the contributors to easily reproduce your problem.  \r\nIf the problem can't be reproduced using these templates, explain why in this section.\r\n\r\n- v0.x: https://codepen.io/FezVrasta/pen/KoxOJM\r\n- v1.x: https://codesandbox.io/s/7mwkynymlq\r\n\r\n-->\r\n https://codesandbox.io/s/xpyk0364op\r\n\r\n### What went wrong?\r\n\r\nWhen `referenceElement` prop is set to `undefined`, `referenceProps.ref` no longer works.\r\n\r\nThere are some useful situations to conditionally use `referenceElement`.\r\n\r\n### What is the expected behavior?\r\n\r\nI think this is probably expected behaviour at the moment, but the doc confused me a little bit with \r\n\r\n> If referenceElement is defined, it will take precedence over any referenceProps.ref provided refs.\r\n\r\nI thought with `referenceElement` set to `undefined` then `referenceProps.ref` would work as expected. \r\n\r\n### Any other comments?\r\n\r\nIt's not a massive issue as you can get around it by doing.\r\n\r\n```jsx\r\nconst { referenceElement } = this.props;\r\nconst popperProps = {};\r\n\r\nif (referenceElement) {\r\n  popperProps.referenceElement = referenceElement;\r\n}\r\n\r\nreturn ( \r\n  <Popper { ...popperProps }>...</Popper>\r\n);\r\n```\r\n\r\n.... just a little nasty that's all. \r\n\r\n### Packages versions\r\n\r\n- Popper.js: 1.14.4\r\n- react-popper: 1.0.2\r\n"}}
{"actor":{"display_login":"HHogg"}}