[Popper + dependents] Add wrapper data attribute - #397
Conversation
|
I believe @chaance proposed similar for #347 but in that case: 🙈 Happy to go with it if you're both considering it though. We can have a That would allow consumers to rename it if they wanted to which is actually a nice feature and makes me feel more comfortable because we're not just exposing it to fix something internal then, we're giving consumers something useful. <Accordion selector="my-org-accordion" />
// Outputs
<div data-my-org-accordion />I would vote for renaming |
|
Oh that's an interesting idea! |
|
We should wait for #347 to be done, to update this one accordingly as the extra prop might not be warranted as @jjenzz puts it:
@jjenzz let me know if you'd rather do this straight in your PR otherwise. |
|
@benoitgrelard One of the benefits of the prop would be for consumers to override our internal selectors if they wanted. This could be very handy if they decide to wrap our components with a different set of naming conventions, and if they'd like to completely close off certain parts in their design systems. We couldn't do that without the |
|
@jjenzz's point here was that this one is an escape hatch for a part that they normally wouldn't need access to. So it would be fine to derive it from the main part. But yeah that does mean you can't rename it fully like the others. What do you think Jenna? |
|
Closing this one now as #347 has addressed it already. |

Closes #368
This PR adds a
data-radix-*attribute to the non-exposed part ofPopper(the positioning wrapper).This is in response to what we have discussed over on this issue: Portalled tooltips appear behind modals/overlays that have z-index #368
I have passed the right name to each dependent component too so you end up with
data-radix-tooltip-content-wrapperfor example. This way users can precisely target only certain components.A few questions here:
wrapperClassnameescape hatch for that I suppose, or even do just that and not bother with the data attributeAlso, doing all this with the part name passed as a prop and the
{...getPartDataAttrObj(partName) }internally made me think that perhaps this is a better solution to this issue: [react-*]: Remove extended internal data attributes #347Thoughts?