# Opção "Anexar arquivo" sem resposta no Safari para desktop

**URL:** https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639
**Category:** Bug
**Tags:** uploads, chat
**Created:** [16 Janeiro , 2026 05:47 UTC](https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639 "2026-01-16T05:47:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [16 Janeiro , 2026 05:47 UTC](https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639/1 "2026-01-16T05:47:25Z")

</div>

No momento, a opção Anexar um arquivo no menu do compositor de bate-papo não funciona enquanto a janela do navegador estiver dimensionada para uma largura apropriada para desktop.

 ![Screenshot 2026-01-15 at 9.26.51 PM](https://global.discourse-cdn.com/meta/original/4X/9/d/d/9dd71307f13e80879ea7d6dec328b9d191731257.png)

A expectativa é que isso abra o seletor de arquivos nativo e permita que você escolha um arquivo para anexar à sua mensagem de bate-papo.

Se você reduzir a largura da janela do seu navegador o suficiente para mudar a interface do usuário para a experiência típica de “dispositivo móvel”, o comportamento funcionará normalmente.

O problema está limitado ao Safari de desktop, não há erros no console do navegador e arrastar e soltar um arquivo funciona bem.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [16 Janeiro , 2026 15:34 UTC](https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639/3 "2026-01-16T15:34:10Z")

</div>

Safari é o novo IE :sadpanda:

> <https://github.com/discourse/discourse/pull/37179>
>
> The file picker wasn't opening when clicking "Attach a file" from the chat compo…ser dropdown menu on desktop Safari.
> 
> Safari requires programmatic file input clicks to happen synchronously within the user gesture event chain. The previous code used \`await closeFn()\` before calling \`button.action()\`, which broke this chain by deferring execution to a new microtask. Safari no longer considered the subsequent \`.click()\` to be user-initiated.
> 
> The fix removes the async/await to keep both calls synchronous within the original click handler.
> 
> This issue cannot be caught by automated tests because our system specs use Chrome, which is more permissive with user activation (allowing a ~5 second window after user interaction). Safari's stricter requirements only manifest in that specific browser.
> 
> References:
> \- https://meta.discourse.org/t/393639
> \- https://webkit.org/blog/13862/the-user-activation-api/
> \- https://macwright.com/2022/07/11/activation.html

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [22 Janeiro , 2026 09:52 UTC](https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639/5 "2026-01-22T09:52:36Z")

</div>

Este tópico foi fechado automaticamente 3 dias após a última resposta. Novas respostas não são mais permitidas.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [29 Janeiro , 2026 09:49 UTC](https://meta.discourse.org/t/attach-a-file-option-unresponsive-in-desktop-safari/393639/6 "2026-01-29T09:49:40Z")

</div>

Infelizmente, a correção quebrou as “opções” naquela lista que abriam um modal…

> <https://github.com/discourse/discourse/pull/37378>
>
> Commit 9cbb0c3da3 fixed Safari file uploads by removing async/await from the but…ton click handler, but this introduced a regression: modal-based buttons (like "Insert date/time") stopped working on mobile.
> 
> The issue is a race condition where the modal tries to open while the dropdown menu modal is still closing, causing the new modal to be dismissed immediately.
> 
> This fix introduces a \`synchronous\` property for chat composer buttons:
> 
> \- \`synchronous: true\` - action runs immediately without awaiting the menu close (required for file inputs on Safari)
> \- \`synchronous: false\` (default) - awaits menu close before running action (required for modal-based buttons)
> 
> The upload button is marked with \`synchronous: true\` to preserve the Safari fix, while all other buttons use the default async behavior.
