ModalBackdrop in 0.9.3 buggy? #1988
-
Hello, I updated to 0.9.3 and use several modals. Since the Backdrop is there no more, I just removed it. But the current implementation seems to have bugs: Code example:
Or am I using it wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
It's not a bug. In fact, the way how it was previously working was wrong. Previously we placed a modal backdrop inside of the modal element, which according to Bootstrap specs is wrong. And also with vanilla Bootstrap nested modals are not supported. Quote from their docs: https://getbootstrap.com/docs/4.6/components/modal/
|
Beta Was this translation helpful? Give feedback.
-
Maybe, just as a workaround you can manually add a backdrop and disable ShowBackdrop. <Modal @ref="modalRef" ShowBackdrop="false">
<div class="modal-backdrop"></div>
<ModalContent Size="@modalSize" Centered="@centered">
<ModalHeader>
<ModalTitle>
<Icon Name="IconName.Edit" />
Employee edit
</ModalTitle>
<CloseButton />
</ModalHeader>
<ModalBody MaxHeight="@maxHeight">
<Field>
<FieldLabel>Name</FieldLabel>
<TextEdit Autofocus="true" Placeholder="Enter name..." />
</Field>
<Field>
<FieldLabel>Surname</FieldLabel>
<TextEdit Placeholder="Enter surname..." />
</Field>
<Field>
<FieldLabel>Date of birth</FieldLabel>
<DateEdit TValue="DateTime?" Placeholder="Pick a date" />
</Field>
<Field>
<Button Color="Color.Primary" Clicked="@ShowModal2">Show second modal</Button>
</Field>
</ModalBody>
<ModalFooter>
<Button Color="Color.Secondary" Clicked="@HideModal">Close</Button>
<Button Color="Color.Primary" Clicked="@HideModal">Save Changes</Button>
</ModalFooter>
</ModalContent>
</Modal> also add: .modal-backdrop{
z-index: -1;
opacity: .3;
} |
Beta Was this translation helpful? Give feedback.
It's not a bug. In fact, the way how it was previously working was wrong. Previously we placed a modal backdrop inside of the modal element, which according to Bootstrap specs is wrong. And also with vanilla Bootstrap nested modals are not supported.
Quote from their docs: https://getbootstrap.com/docs/4.6/components/modal/