Skip to content

Form fields (React Select and Date Picker) are cut or missing in screenshots generated by html2canvas in a React Hook Form setup #3248

@mansoorsaleem444

Description

@mansoorsaleem444

Summary

When using html2canvas to capture a screenshot of a form built with React Hook Form, some input fields — especially custom components like react-select dropdowns and date pickers — are partially rendered or completely cut off in the output image.

This issue seems to affect third-party components that render dropdowns or floating elements via portals or overlays.


Steps to Reproduce

  1. Create a React form using react-hook-form
  2. Add inputs using:
    • react-select for dropdowns
    • A date field using react-datepicker or Material UI DatePicker
  3. Wrap the form in a ref and pass it to html2canvas
  4. Click a button to trigger a screenshot
  5. Observe that:
    • Some form controls are missing entirely
    • Dropdowns or calendars are cut off or not rendered correctly

Expected Behavior

All visible fields and custom inputs (including dropdowns and date pickers) should appear correctly in the canvas/screenshot.


Actual Behavior

  • Some custom components (like react-select) are missing or rendered incorrectly
  • Date picker popups or dropdowns are either invisible or cut off
  • Possibly related to components being rendered in portals or absolute positioning[

Image

](url)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions