# DOM.uid fails when hash fragment present

**URL:** <https://talk.observablehq.com/t/dom-uid-fails-when-hash-fragment-present/2340>\
**Category:** Feedback\
**Created:** [September 3, 2019, 3:37am UTC](https://talk.observablehq.com/t/dom-uid-fails-when-hash-fragment-present/2340 "2019-09-03T03:37:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rreusser](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/rreusser/32/1976_2.png) [@rreusser](https://talk.observablehq.com/u/rreusser)\
**Post date:** [September 3, 2019, 3:37am UTC](https://talk.observablehq.com/t/dom-uid-fails-when-hash-fragment-present/2340/1 "2019-09-03T03:37:40Z")

</div>

I’ve noticed that when a hash fragment is present, `DOM.uid` doesn’t work correctly. You can see an example here (`#foo` causes clipping to revert to its broken state) : [SVG Clipping Test / Mike Bostock | Observable](https://observablehq.com/@mbostock/svg-clipping-test#foo)

I submitted a PR [here](https://github.com/observablehq/stdlib/pull/114) to fix it by just trimming off the existing hash fragment before adding a new one. I thought perhaps it got lost in the shuffle so that it would be appropriate to report it more directly here. Thanks!

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [September 3, 2019, 3:51am UTC](https://talk.observablehq.com/t/dom-uid-fails-when-hash-fragment-present/2340/2 "2019-09-03T03:51:03Z")

</div>

Thanks for the ping. I just reviewed.
