atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.91k stars 518 forks source link

remove inline style for arrow #985

Closed sshanzel closed 2 years ago

sshanzel commented 2 years ago

I have a fairly simple custom arrow as below:

<div data-popper-arrow />

The point is I am applying a custom style also, which works but the issue is, there is always an inline style automatically applied by which I think is by default. I can override those styles using !important through CSS but I want to know if there's a way to actually remove those default inline stylings.

I have tried the snippet below but no luck:

      popperOptions={{
        modifiers: [
          {
            name: 'arrow',
            options: {
              element: arrowRef,
              padding: ({ popper, reference, placement }) =>
                popper.width / reference.width,
            },
          },
        ],
      }}

The arrow resulted by tippy:

<div data-popper-arrow="true" class="LazyTooltip_tippyTooltipArrow__1e9O8 bg-theme-label-primary" style="position: absolute; left: 0px; transform: translate3d(0px, 0px, 0px);"></div>

The inline style I'm talking about to be removed is the value below:

style="position: absolute; left: 0px; transform: translate3d(0px, 0px, 0px);"
atomiks commented 2 years ago

If you don't want positioning, then you don't pass the arrow to the Popper options config

sshanzel commented 2 years ago

Hi! Thank you for quickly responding. Yes I have removed that also but the inline style property still persist. Is this an issue? If yes, then I'm more than willing to contribute. Thank you!

atomiks commented 2 years ago

remove data-popper-arrow