{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/4070","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/4070/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/4070/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/4070/events","html_url":"https://github.com/ant-design/ant-design/issues/4070","id":192468453,"number":4070,"title":"Anchor: scrollTo helper truncating the first char, assumes ID. Error prone and pointless.","user":{"login":"jkoudys","id":586985,"avatar_url":"https://avatars2.githubusercontent.com/u/586985?v=4","gravatar_id":"","url":"https://api.github.com/users/jkoudys","html_url":"https://github.com/jkoudys","followers_url":"https://api.github.com/users/jkoudys/followers","following_url":"https://api.github.com/users/jkoudys/following{/other_user}","gists_url":"https://api.github.com/users/jkoudys/gists{/gist_id}","starred_url":"https://api.github.com/users/jkoudys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkoudys/subscriptions","organizations_url":"https://api.github.com/users/jkoudys/orgs","repos_url":"https://api.github.com/users/jkoudys/repos","events_url":"https://api.github.com/users/jkoudys/events{/privacy}","received_events_url":"https://api.github.com/users/jkoudys/received_events","type":"User","site_admin":false},"labels":[{"id":203750412,"url":"https://api.github.com/repos/ant-design/ant-design/labels/Bug%F0%9F%90%9E","name":"Bug🐞","color":"fc2929","default":false}],"state":"closed","locked":false,"assignee":{"login":"RaoHai","id":566097,"avatar_url":"https://avatars2.githubusercontent.com/u/566097?v=4","gravatar_id":"","url":"https://api.github.com/users/RaoHai","html_url":"https://github.com/RaoHai","followers_url":"https://api.github.com/users/RaoHai/followers","following_url":"https://api.github.com/users/RaoHai/following{/other_user}","gists_url":"https://api.github.com/users/RaoHai/gists{/gist_id}","starred_url":"https://api.github.com/users/RaoHai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaoHai/subscriptions","organizations_url":"https://api.github.com/users/RaoHai/orgs","repos_url":"https://api.github.com/users/RaoHai/repos","events_url":"https://api.github.com/users/RaoHai/events{/privacy}","received_events_url":"https://api.github.com/users/RaoHai/received_events","type":"User","site_admin":false},"assignees":[{"login":"RaoHai","id":566097,"avatar_url":"https://avatars2.githubusercontent.com/u/566097?v=4","gravatar_id":"","url":"https://api.github.com/users/RaoHai","html_url":"https://github.com/RaoHai","followers_url":"https://api.github.com/users/RaoHai/followers","following_url":"https://api.github.com/users/RaoHai/following{/other_user}","gists_url":"https://api.github.com/users/RaoHai/gists{/gist_id}","starred_url":"https://api.github.com/users/RaoHai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaoHai/subscriptions","organizations_url":"https://api.github.com/users/RaoHai/orgs","repos_url":"https://api.github.com/users/RaoHai/repos","events_url":"https://api.github.com/users/RaoHai/events{/privacy}","received_events_url":"https://api.github.com/users/RaoHai/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-11-30T03:46:08Z","updated_at":"2018-05-02T15:13:35Z","closed_at":"2017-01-13T13:39:12Z","author_association":"NONE","body":"There are several things wrong with the \"href\" in an `<Anchor.Link>`.\r\n\r\n1. It isn't an href, but a selector.\r\n2. Using a selector is very limiting. I propose allowing it to take a `DOMNode`, that way you could easily pass in the results from a `document.querySelector` if you wanted to get the same result. Calling it `target` would make sense since it's the target of the AnchorLink.\r\n3. This is especially bad, because it's both assuming it's an ID selector, and for some reason truncating it: `const targetElement = document.getElementById(href.substring(1));`\r\n4. If your href were '.foobar', but there was a '#foobar' on the page, that's what it would match. This would be a massive pain to debug.\r\n5. It's a pointless waste and added confusion to pass this to a `getElementById`, when you could simply `querySelector`.\r\n\r\nhttps://github.com/ant-design/ant-design/blob/ee2654dbe1a6532f60b146bf6f9f3346299553c8/components/anchor/anchorHelper.tsx#L48\r\n\r\nWhile there are many problems with this approach, taking a 'target' property as a DOMNode solves them all."},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/386013280","html_url":"https://github.com/ant-design/ant-design/issues/4070#issuecomment-386013280","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/4070","id":386013280,"user":{"login":"lock[bot]","id":33595554,"avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-05-02T15:13:35Z","updated_at":"2018-05-02T15:13:35Z","author_association":"NONE","body":"This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.\n"}}
{"actor":{"display_login":"lock"}}