Skip to content

Commit

Permalink
IBX-9135:[ALW] grayed out effect issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Oct 30, 2024
1 parent cd4176a commit 7fa287c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/bundle/ui-dev/src/modules/common/popup/popup.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const Popup = ({
});
const closeBtnLabel = Translator.trans(/*@Desc("Close")*/ 'popup.close.label', {}, 'ibexa_universal_discovery_widget');
const hidePopup = () => {
modalRef.current.removeEventListener('hidden.bs.modal', onClose);
bootstrap.Modal.getOrCreateInstance(modalRef.current).hide();
rootDOMElement.classList.remove(CLASS_MODAL_OPEN, CLASS_NON_SCROLLABLE);
};
Expand All @@ -79,10 +80,13 @@ const Popup = ({

bootstrapModal.show();
};
const handleOnClick = (event, onClick) => {
const handleOnClick = (event, onClick, preventClose) => {
modalRef.current.removeEventListener('hidden.bs.modal', onClose);
hidePopup();
onClick(event);
if (!preventClose) {
hidePopup();
}

onClick(event, hidePopup);
};
const renderCloseBtn = () => {
if (noCloseBtn) {
Expand Down Expand Up @@ -119,12 +123,12 @@ const Popup = ({
)}
<div className="modal-body c-popup__body">{children}</div>
<div className="modal-footer c-popup__footer">
{actionBtnsConfig.map(({ className, onClick, disabled = false, label, ...extraProps }) => (
{actionBtnsConfig.map(({ className, onClick, disabled = false, preventClose = false, label, ...extraProps }) => (
<button
key={label}
type="button"
className={`btn ibexa-btn ${className}`}
onClick={onClick ? (event) => handleOnClick(event, onClick) : hidePopup}
onClick={onClick ? (event) => handleOnClick(event, onClick, preventClose) : hidePopup}
disabled={disabled}
{...extraProps}
>
Expand All @@ -145,6 +149,7 @@ Popup.propTypes = {
onClick: PropTypes.func,
disabled: PropTypes.bool,
className: PropTypes.string,
preventClose: PropTypes.bool,
}),
).isRequired,
children: PropTypes.node.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/ui-dev/src/modules/common/spinner/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createCssClassNames } from '@ibexa-admin-ui/src/bundle/ui-dev/src/modul
export const SIZES = {
SMALL: 'small',
MEDIUM: 'medium',
SIZES: 'large',
LARGE: 'large',
};

const Spinner = ({ size }) => {
Expand Down

0 comments on commit 7fa287c

Please sign in to comment.