Why is my Vue dialog clipped?
The Confirm button exists in the DOM, but the article panel clips it. The dialog uses fixed positioning. Its ancestor has a CSS transform, which establishes the containing block for this fixed descendant. The panel also has hidden overflow, so the button falls outside the visible area. Increasing the dialog’s stacking order would leave that clipping boundary in place.
App.vue wraps the dialog in Vue’s built-in Teleport component. Turning on the checkbox changes its physical parent from the article panel to the document body. The dialog escapes the panel and Confirm becomes clickable.
The parent component still supplies the title prop and listens for the child’s confirmation event. In the English browser fixture, clicking Confirm closes the dialog and updates the parent’s counter to one. The test captured both states and checked the hit target at the center of the button. Browser evidence.
Use Teleport when an overlay needs to leave an ancestor’s layout constraints. A production dialog also needs focus management, a keyboard dismissal policy and appropriate background interaction. This example isolates positioning and event handling.
Original example and captures by Knowvore. The Vue guide text is licensed under CC BY 4.0, credited to Evan You and Vue documentation contributors. Vue Teleport guide · Documentation license.