Skip to content

[HxModal] Close button improper layout when custom icon is used #1080

@Xopabyteh

Description

@Xopabyteh

When I change the default icon of HxModal

HxModal.Defaults.CloseButtonIcon = MyIcons.Close;

The close buttons on the modal loses its layout styling, because of these lines:

if (CloseButtonIconEffective is null)
{
	<button type="button" class="btn-close text-reset" data-bs-dismiss="modal" aria-label="Close"></button>
}
else
{
	<div role="button" data-bs-dismiss="modal" aria-label="Close"><HxIcon Icon="CloseButtonIconEffective"/></div>
}

where the close button loses the btn-close, which is used internally in bootstrap like so:

.modal-header .btn-close {
    padding: calc(var(--bs-modal-header-padding-y) * .5) calc(var(--bs-modal-header-padding-x) * .5);
    margin-top: calc(-.5 * var(--bs-modal-header-padding-y));
    margin-right: calc(-.5 * var(--bs-modal-header-padding-x));
    margin-bottom: calc(-.5 * var(--bs-modal-header-padding-y));
    margin-left: auto;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions