fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

refs.root breaks between 4.9.0 and 4.9.1

Open carruthe opened this issue 9 years ago • 3 comments

**Bug report **

I rely on a saved ref from the component to do some layout formatting for my Excel add-in. I used the ref property of the component, and save a reference to alias.refs.root. Between 4.9.0 and 4.9.1, this functionality broke - alias.refs.root is no longer defined.

React Version: 15.4.2 up to 15.6.1 Browser: Reproduced on Safari and Chrome (MacOS), and Chrome (Windows)

Here is a CodePen reproducing the behavior:

https://codepen.io/tcarruthers/pen/vZJeaw

Thanks!

Nick

carruthe avatar Jun 23 '17 15:06 carruthe

Thanks Nick!

@dzearing Do you think changes in Fabric.tsx in https://github.com/OfficeDev/office-ui-fabric-react/pull/2026 PR might be causing this? Or there is a better way to access that ref?

atneik avatar Jun 26 '17 05:06 atneik

FYI - I found a CSS workaround to this, so I am no longer relying on the alias.refs.root to get the React-created wrapper div:

Add CSS to React-Created Elements

carruthe avatar Jun 30 '17 14:06 carruthe

Closing since workaround was found and because use of this._resolveRef() is recommended . Please reopen if this is still an issue.

erichdev avatar Oct 12 '17 22:10 erichdev