Skip to content

fix: load Image/IFrame sources when disabled#24346

Merged
Artur- merged 1 commit into
mainfrom
issues/22772-download_handler_disabled_components
May 15, 2026
Merged

fix: load Image/IFrame sources when disabled#24346
Artur- merged 1 commit into
mainfrom
issues/22772-download_handler_disabled_components

Conversation

@mcollovati
Copy link
Copy Markdown
Collaborator

When an Image or IFrame backed by a DownloadHandler lives inside a disabled component, the browser receives a 403 and the resource never loads.

Image.setSrc(DownloadHandler) and IFrame.setSrc(DownloadHandler) now allow the resource to be served regardless of the owner's enabled state, since these sources are fetched passively as part of rendering rather than as a user action.

Fixes #22772

When an `Image` or `IFrame` backed by a `DownloadHandler` lives inside
a disabled component, the browser receives a 403 and the resource
never loads.

`Image.setSrc(DownloadHandler)` and `IFrame.setSrc(DownloadHandler)`
now allow the resource to be served regardless of the owner's enabled
state, since these sources are fetched passively as part of rendering
rather than as a user action.

Fixes #22772
@sonarqubecloud
Copy link
Copy Markdown

@mcollovati
Copy link
Copy Markdown
Collaborator Author

Follow-up needed in vaadin/flow-components: if this PR gets merged, components that accept a DownloadHandler as a display-only source (e.g. SvgIcon.setSrc) should call .allowDisabled() on it before registering it on the element, so the resource keeps loading when the owning component is disabled (like what Image.setSrc now does).

@github-actions
Copy link
Copy Markdown

Test Results

 1 410 files  + 2   1 410 suites  +2   1h 23m 43s ⏱️ + 1m 7s
10 160 tests +10  10 090 ✅ +10  70 💤 ±0  0 ❌ ±0 
10 635 runs  +10  10 556 ✅ +10  79 💤 ±0  0 ❌ ±0 

Results for commit 9aefbb0. ± Comparison against base commit 2e3d63f.

@Artur- Artur- added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit e1d46ea May 15, 2026
31 checks passed
@Artur- Artur- deleted the issues/22772-download_handler_disabled_components branch May 15, 2026 11:44
@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @mcollovati and @Artur-, when i performed cherry-pick to this commit to 24.10, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick e1d46ea
error: could not apply e1d46ea... fix: load Image/IFrame sources when disabled (#24346)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @mcollovati and @Artur-, when i performed cherry-pick to this commit to 25.0, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick e1d46ea
error: could not apply e1d46ea... fix: load Image/IFrame sources when disabled (#24346)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @mcollovati and @Artur-, when i performed cherry-pick to this commit to 24.9, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick e1d46ea
error: could not apply e1d46ea... fix: load Image/IFrame sources when disabled (#24346)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

caalador pushed a commit that referenced this pull request May 19, 2026
)

When an Image or IFrame backed by a DownloadHandler lives inside a disabled component, the browser receives a 403 and the resource never loads.

Image.setSrc(DownloadHandler) and IFrame.setSrc(DownloadHandler) now allow the resource to be served regardless of the owner's enabled state, since these sources are fetched passively as part of rendering rather than as a user action.

Fixes #22772
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.2.0-alpha8.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icons with DownloadHandler do not work for disabled components

4 participants