You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!
I've observed some puzzling behavior on modals:
If I add a hyperlink at the end of a modal body, for some reason the modal will pop up scrolled all the way to the bottom.
I can work around it, but I believe the behavior produced by the workaround should be the default behavior
What type of pull request would this be?
Enhancement
Any links to similar examples or other references we should review?
This is my workaround:
<script>
import {Modal,modalStore} from '@skeletonlabs/skeleton';
async function triggerAlert() {constalert={type: 'alert',title: 'Example Alert',body: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at mauris ut nisl molestie eleifend ac a neque. Nunc sit amet malesuada orci. Sed id consequat neque. Pellentesque vel urna varius, fringilla odio et, congue diam. <br /> <br /> <a href="https://google.com">href</a>`,buttonTextCancel: 'Cancel'};// workaround for scroll issue:awaitmodalStore.trigger(alert);document.querySelector('.modal-body').scrollTop=0}</script><ModalregionBody='max-h-24 overflow-auto'width='max-w-xs'/><divclass="container h-full mx-auto flex justify-center items-center"><buttonclass="btn variant-filled-primary btn-base"on:click={triggerAlert}> Open Modal </button></div>
The text was updated successfully, but these errors were encountered:
We're in a polish phase for Skeleton and going in this order: Elements (done), Components (in progress), Utilities (up next). Given modals are a utility feature they'll come during that phase. Cross posting will help me see this when we get to that point.
FYI, awaiting the trigger is not reliable. A more reliable workaround is to put a hidden input tag at the top of the modal body to steal the focus:
<script>
import {Modal,modalStore} from '@skeletonlabs/skeleton';
function triggerAlert() {constalert={type: 'alert',title: 'Example Alert',body: `<input class = "hidden">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at mauris ut nisl molestie eleifend ac a neque. Nunc sit amet malesuada orci. Sed id consequat neque. Pellentesque vel urna varius, fringilla odio et, congue diam. <br /> <br /> <a href="https://google.com">href</a>`,buttonTextCancel: 'Cancel'};modalStore.trigger(alert);}</script><ModalregionBody='max-h-24 overflow-auto'width='max-w-xs'/><divclass="container h-full mx-auto flex justify-center items-center"><buttonclass="btn variant-filled-primary btn-base"on:click={triggerAlert}> Open Modal </button></div>
Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!
I've observed some puzzling behavior on modals:
What type of pull request would this be?
Enhancement
Any links to similar examples or other references we should review?
This is my workaround:
The text was updated successfully, but these errors were encountered: