Skip to content

fix: respect lazyHtmlGeneration for consent modal - #832

Open
Steve0x2a wants to merge 1 commit into
orestbida:masterfrom
Steve0x2a:fix/lazy-consent-modal
Open

Steve0x2a wants to merge 1 commit into
orestbida:masterfrom
Steve0x2a:fix/lazy-consent-modal

Conversation

@Steve0x2a

Copy link
Copy Markdown

lazyHtmlGeneration is documented as delaying modal markup until a modal is about to become visible, but generateHtml always built the consent modal whenever consent was invalid. With autoShow: false that left an unused role="dialog" in the document.

Gate createConsentModal on lazyHtmlGeneration the same way as the preferences modal. show() still creates the consent modal when consent is invalid, so CookieConsent.show() continues to work.

Credits @okadriu for the report and the named generateHtml path.

Fixes #830

Signed-off-by: Yi Zhan <stevesough@gmail.com>
@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for cookieconsentv3-playground canceled.

Name Link
🔨 Latest commit 89907e2
🔍 Latest deploy log https://app.netlify.com/projects/cookieconsentv3-playground/deploys/6a9a8f362067df0008c92b55

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@Steve0x2a is attempting to deploy a commit to the Orest Bida's projects Team on Vercel.

A member of the Team first needs to authorize it.

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]: consent modal markup is generated even with autoShow: false and lazyHtmlGeneration: true

1 participant