Question about Ant Design Overlay
See original GitHub issueI am running into errors when working with ant design overlays, but am unable to pinpoint what the issue is, so I cannot reproduce the error in a demo repo.
The error I get is “Failed to add overlay to the container”, which is in line 333 of your overlay code file.
if (_position is null && _recurenceGuard <= 10) //up to 10 attempts
{
Console.WriteLine($"Failed to add overlay to the container. Container: {Trigger.PopupContainerSelector}, trigger: {Trigger.Ref.Id}, overlay: {Ref.Id}. Awaiting and rerunning.");
await Task.Delay(10);
await AddOverlayToBody(overlayLeft, overlayTop);
}
I’d like to understand why you decided to check up to 10 attempts for the position of an overlay and what can potentially trigger this error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hi, I have a workaround for the issue. Not sure if this is helpful for diagnosing what caused the issue.
For Ant design dropdown, the issue disappears when I create an empty trigger and instead use the Visible property to control whether the dropdown is visible.
Overlay Error code:
Fixed code that doesn’t cause error:
I mean you can download the whole project source code and build the project locally.