• Mohamed Aziz Mejri's avatar
    Fixing file attachement (#2541) · 99137f92
    Mohamed Aziz Mejri 提交于
    The migration from Radix to Base UI broke file attachments because
    calling e.preventDefault() in the onClick handler does not stop Base UI
    menus from closing. Base UI relies on an internal closeOnClick mechanism
    instead. As a result, when the menu closed, the portaled hidden <input
    type="file"> elements were unmounted from the DOM before the user could
    select a file.
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2541"
    target="_blank">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    
    <!-- This is an auto-generated description by cubic. -->
    ## Summary by cubic
    Fixes the file attachment menu so selecting “Attach chat context” or
    “Upload to codebase” no longer closes the dropdown too early. Uses
    closeOnClick={false} with direct onClick handlers to keep hidden inputs
    mounted and make file selection reliable.
    
    <sup>Written for commit afe8de3b5de300b8c2254418aa9bbd87d818c0bf.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    99137f92