question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Class needs to be removed in <Popover/>

See original GitHub issue

✅ I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

N/A

Steps to reproduce

Simply render a normal popover component.

What is expected?

I expect to be able to completely customize the entirety of the popover inner content.

What is actually happening?

There is padding that is inserted via a child class of ant-popover-inner (which is provided by overlayInnerStyle prop) called ant-popover-inner-content. This class ant-popover-inner applies redundant padding and styling that does not need to exist.

Environment Info
antd 4.16.13
React React 17
System Latest MacOSX
Browser Latest Chrome

There are multiple comments in issues that mention this and are completely valid. We need to be able to remove padding, or it doesn’t need to be there at all. There is 0 use for it. The styling cannot be locally overridden since the class is sub-rendered by the popover component.

See this comment, which has some support: https://github.com/ant-design/ant-design/issues/11364#issuecomment-722771445

Below is what the DOM looks like. See comments below.

<div class="ant-popover ant-popover-placement-bottom ">
  <div class="ant-popover-content">
    <div class="ant-popover-arrow">
      <span class="ant-popover-arrow-content"></span>
    </div>
    <div class="ant-popover-inner" role="tooltip" style="margin: 0px; padding: 0px; border: none;"> <!-- overlayInnerStyle -->
    <div class="ant-popover-inner-content"> 
    <!-- This class is adding unnecessary styling and prevents us from overriding locally. It needs to be removed.
      .ant-popover-inner-content {
            padding: 12px 16px;
            color: rgba(0, 0, 0, 0.85);
        } 
    -->
      <!-- Inner Content Goes Here-->
    </div>
  </div>
</div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
afc163commented, Sep 24, 2021

You can use overlayInnerStyle to remove default padding.

12reactions
spencer741commented, Sep 29, 2021

@afc163 Referencing the code block of the issue, OverlayInnerStyle applies To ant-popover-inner, not to ant-popover-inner-content.

OverlayInnerStyle needs to apply to ant-popover-inner-content, which is the direct wrapper of the inner popover. It does not need to apply to ant-popover-inner (the parent of ant-popover-inner-content).

<div class="ant-popover-inner" role="tooltip" style="margin: 0px; padding: 0px; border: none;"> <div class="ant-popover-inner-content">
Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove class from element inside bootstrap popover
If you just want to remove a class when the checkbox change, this works fine : $(".checkable").change(function() { $(".popover-item").
Read more >
Popovers - Bootstrap
Popovers must be hidden before their corresponding elements have been removed from the DOM. Keep reading to see how popovers work with some...
Read more >
Popovers - Stacks
Popovers are small content containers that provide a contextual overlay. They can be used as in-context feature explanations, dropdowns, or tooltips.
Read more >
Bootstrap JS Popover Reference - W3Schools
Name Type Default Try it animation boolean true Try it container string, or the boolean false false Try it content string "" Try it
Read more >
Bootstrap Popovers - examples & tutorial
Bootstrap popover is a component which displays a box with a content after a click on an ... The outermost wrapper element should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found