react-map-interaction icon indicating copy to clipboard operation
react-map-interaction copied to clipboard

Ability to style wrapper divs

Open andriadze opened this issue 6 years ago • 3 comments

I think library adds two wrapper divs. Both of them have inline style and they have no classname or id given to them.

andriadze avatar Jul 31 '19 06:07 andriadze

What is the use case that you aren't able to accomplish? The wrapper div will size itself to its parent. So the parent div that you provid, wrapping this component, can be sized/styled however you like. If this isn't enough though, then I think its fine to add props for inline styles to map-interaction.

scottyantipa avatar Jul 31 '19 15:07 scottyantipa

Well use case is quite simple, I have a component that takes up height of its direct parent. So all I needed to do was give the wrapper view a height property in css and that was that.

I mean just giving classNames to the divs won't hurt anything.

I solved it by just copying content from MapInteractionsCss and updating that one css line.

andriadze avatar Aug 01 '19 07:08 andriadze

The ability to modify the wrapper style through classes or style props is useful when the container has its display set to flex, for instance (I ran into this right now, but maybe there are some other examples). In that case, the children of MapInteractionsCSS won't be affected affected by the wrapper's width or height

ametis70 avatar Sep 25 '20 00:09 ametis70