Open futurewebEubling opened 3 years ago
Hi @futurewebEubling! You can enforce the opening of the modal using
// using the default config
klaro.show(undefined, {modal: true})
// using a specific config
klaro.show(config, {modal: true})
We don't automatically open the modal as in some cases you want to trigger the showing of the notice manually, hence we do not always open the modal with the show()
call, unless the modal
option is explicitly given. Does that solve your issue?
Hi @adewes, this is a rather inconsistent behavior of the show() call.
If you call show() when no Consent Selection has yet been made:
When calling show() after making a selection:
So calling the Function the same way results in a different behaviour regarding the current State of the App. IMHO a called Function should always have consistant behavior, don't you think ... ? ;-)
Just my 2 Cents on this ;-)
bye from sunny Austria Andreas
Good points @futureweb! Do you think showNotice()
and showModal()
functions would be better?
Hey @adewes, guess that would be one way to ensure a consistant app behaviour regardless of the current State of the App. AFAIK Usercentrics and other CMPs also implemented it that way ... ;-) One could leave show() as (pseudo intelligent) Wrapper to the new Calls for legacy compatibility ... with a short Notice of it's special behaviour in the Docs. (Show Notice while no selection has been made, Show Modal after selection has been made) bye from sunny Austria Andreas
HTML of JS "klaro.show()" cookie button:
<a class="button is-success" onclick="return klaro.show();">Cookies</a>
Steps to reproduce
Open any website with Klaro cookie consent manager and try to open the configuration "cookie-modal" by clicking the JS "klaro.show()" button before accepting or declining the "cookie-notice". For example: https://www.futureweb.at/ (button "Cookies" at the very bottom right)
Current behavior
"cookie-modal" configuration is not opening by clicking the klaro.show() JS button as long as you have not accepted or declined all cookies in "cookie-notice".
Expected behavior
The "cookie-modal" configuration should open any time by clicking the klaro.show() JS button even if you have not already accepted or declined the cookie-notice.