-
Notifications
You must be signed in to change notification settings - Fork 32
Adding withAITracking will break styling for components (e.g. full width/height) #73
Comments
Hi @hanvyj - AFAIK it is common for HOC to wrap the original component with a div. I have used it in other projects without it affecting the styles. Is it not something that you can work around by just changing your CSS rules? I can add a custom class for the wrapper div but I'd rather consumers just worked around it by targeting elements accordingly. |
You can work around it but it requires you to add some custom styling whever you use a component that's being tracked (with some components anyway). Seems like it should be the responsibility of the component to style itself rather than rely on anything using it to remember and add some styling. It just makes me uncomfortable having a situation where I have a reminder "Remember to add this style to the parent of this component or it'll break!" or something. Ultimately, it's a simple workaround though. Up to you guys of you think it's not something to include? Happy for you to close the ticket if so. Edit: Although I just had a bug where the 'tracked' component is sometimes in a child, sometimes not - not having the child control the div means the parent's styles |
Can you please advise what is your suggested workaround is? Thanks. cc @pviotti - FYI. |
I'm not sure if it would be the best option, but could you just pass through an optional class to set on the div?
I'll can try do a pull request if I've got some spare time and you think it would be a sensible change? |
Hi, I have the same problem here, did you find a way to solve it ? |
Just a way to fix Azure#73
I just had an issue where I wrapped a component with
withAITracking
for a component that was scaled to the full width and height of it's parent (width: "100%"; height: "100%"
).As the beta now wraps the componet in a
div
element for the tracking, and thisdiv
is unstyled, the resulting wrapped component no longer fills the screen.The text was updated successfully, but these errors were encountered: