Skip to content

Conversation

@naaa760
Copy link
Contributor

@naaa760 naaa760 commented Dec 3, 2025

fix: #21092

  • Range DatePicker in Modal required two clicks to open calendar when input was in masked scroll area.

Fix: Auto-detect modals and append calendar to modal container + prevent Modal's auto-scroll from interfering with DatePicker positioning.

Result: Calendar opens correctly on first click in scrollable modals.

@naaa760 naaa760 requested a review from a team as a code owner December 3, 2025 07:27
@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 7baca78
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/692fe65b1b3827000702ae13
😎 Deploy Preview https://deploy-preview-21109--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.59%. Comparing base (eed514e) to head (7baca78).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ges/react/src/components/DatePicker/DatePicker.tsx 62.50% 3 Missing ⚠️
packages/react/src/components/Modal/Modal.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21109      +/-   ##
==========================================
- Coverage   92.60%   92.59%   -0.02%     
==========================================
  Files         515      515              
  Lines       38225    38234       +9     
  Branches     5863     5839      -24     
==========================================
+ Hits        35397    35401       +4     
- Misses       2678     2683       +5     
  Partials      150      150              
Flag Coverage Δ
main-packages 85.58% <50.00%> (-0.03%) ⬇️
web-components 96.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 7baca78
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/692fe65b596fef00082f6afb
😎 Deploy Preview https://deploy-preview-21109--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7baca78
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/692fe65b1e2ec40008902ac1
😎 Deploy Preview https://deploy-preview-21109--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@adamalston adamalston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add testing?

Comment on lines +668 to +682
// Auto-detect if DatePicker is in a modal and use appendTo for proper positioning
let effectiveAppendTo = appendTo;
if (!effectiveAppendTo && start) {
// Check if the input is inside a modal
const modalElement = start.closest(`.${prefix}--modal`);
if (modalElement) {
// Find the modal container to append the calendar to
const modalContainer = modalElement.querySelector(
`.${prefix}--modal-container`
);
if (modalContainer) {
effectiveAppendTo = modalContainer as HTMLElement;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few concerns:

  1. This change appears to target only modals. Are you certain the issue is limited to modals?
  2. This functionality relies on class selectors. Is there a more robust way to target modals than using class names? I have the same concern regarding the changes in Modal.tsx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Range DatePicker with calendar in Modal requires two selections to edit its value

2 participants