Fix action menu modals rendering inside dropdown containers#16478
Fix action menu modals rendering inside dropdown containers#16478charlesBochet merged 4 commits intomainfrom
Conversation
…ust effectiveContainer logic
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
| const effectiveContainer = ignoreContainer | ||
| ? document.body || null | ||
| : container; | ||
| const isInContainer = isDefined(effectiveContainer); |
There was a problem hiding this comment.
Bug: The modal backdrop incorrectly receives position: absolute instead of position: fixed for full-screen modals because isInContainer is miscalculated when effectiveContainer defaults to document.body.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The change to default ignoreContainer to true and set effectiveContainer to document.body introduces a logical bug. The variable isInContainer is now always true for full-screen modals, as it checks isDefined(effectiveContainer). This incorrectly applies position: absolute to the modal backdrop instead of the intended position: fixed. Consequently, the backdrop may not cover the entire viewport when the page is scrolled and can lead to z-index and layering issues, contradicting the goal of making modals full-screen by default.
💡 Suggested Fix
The calculation for isInContainer should be updated. It should not be based on whether effectiveContainer is defined. Instead, it should reflect whether the modal is meant to be constrained within a specific parent element, which is the case when the container prop is passed and ignoreContainer is false.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
packages/twenty-front/src/modules/ui/layout/modal/components/Modal.tsx#L233-L236
Potential issue: The change to default `ignoreContainer` to `true` and set
`effectiveContainer` to `document.body` introduces a logical bug. The variable
`isInContainer` is now always `true` for full-screen modals, as it checks
`isDefined(effectiveContainer)`. This incorrectly applies `position: absolute` to the
modal backdrop instead of the intended `position: fixed`. Consequently, the backdrop may
not cover the entire viewport when the page is scrolled and can lead to z-index and
layering issues, contradicting the goal of making modals full-screen by default.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6894383
…odal component's ignoreContainer default to false
…ries and add onConfirmClick handler
…ignoreContainer prop
|
Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
|
Thanks @abdulrahmancodes for your contribution! |

Closes #16363