I would like to disable a route
I'm thinking about how to improve sib-subscription. For this use case, I would like to disable routes while conditions I've chosen aren't fulfilled.
I imagine something like this :
<solid-router
default-route="preliminaryInformationForm"
route-prefix=""
use-hash
>
<solid-route name="preliminaryInformationForm" active>
Informations préalables</div>
</solid-route>
<solid-route name="personalInformationForm" disabled>
Saisi de vos informations personnelles</div>
</solid-route>
<solid-route name="acceptancePreContractualDocuments" disabled>
Lecture et acceptation des documents précontractuels</div>
</solid-route>
</solid-router>
In my dream, I imagine making it able by requesting it manually like this :
//Prevent form submission and go to next step
let privacyPolicy = document.getElementById("privacy_policy")
privacyPolicy.addEventListener("submit", function (event) {
window.dispatchEvent(
new CustomEvent("requestNavigation", {
detail: { route: "personalInformationForm" }
})
);
event.preventDefault();
});
Is my dream possible ? :)