v6: Datepicker and Toast are placed inside dialog ,they are rendering wrong, and I like anchor position api more

Open
#43,170 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
css, javascript
Domain
frontend

Research direction

Start with the reduced test case at https://github.com/shenjunjian/bs6-demo and inspect how the datepicker and toast render inside a modal dialog in Bootstrap 6 alpha. Reproduce the reported behavior in Chrome, then check how Bootstrap’s Floating UI integration handles these components in the top layer. Done means the rendering issue is understood and the components behave correctly in the reduced case.

Written by the indexing model from the issue text.

Description

bug confirmed has-pr js v6
Prerequisites
Describe the issue
TopLayer

Due to TopLayer rendering, when a Datepicker component and a Toast component are placed inside a <dialog> element, the child components exhibit rendering anomalies.

TopLayer rendering is a powerful feature of browsers; however, it disrupts many standard behaviors and is incompatible with numerous third-party plugins.However, I prefer to use the browser's native behavior, so I still recommend using dialog.showModal(); avoid using dialog.show()

Why am I validating this combination?

While reviewing the documentation, I noticed that bs6 depends on floating-ui; my original intention was to verify whether floating-ui conflicts with TopLayer.
Since I am familiar with TopLayer's mechanism, I realized that using tooltips and Popovers in a dialog is highly likely to introduce bugs; typically, component libraries insert the pop-up layer at the bottom of the body.Fortunately, the BS6 was inserted inside the dialog, so I was unable to reproduce the bug.

Why not give up floating-ui?

I wonder why we haven't simply used the Popover API and the Anchor Position API directly; since this is a brand-new framework, why not take a more radical approach?The only consequence is that you'll need to update your browser; I see that the latest versions of Chrome, Firefox, and Safari already support it.

Reduced test cases

https://github.com/shenjunjian/bs6-demo

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

6.0 alpha

Dominant language
MDX
Stars
175k
Forks
78.7k
Avg merge
1d 7h
Merged PRs (30d)
103

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twbs/bootstrap

All issues in twbs/bootstrap

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.