siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
174 stars 62 forks source link

IX Modal Component throwing exception on disposing it #1344

Open nitingondule-xdt opened 1 week ago

nitingondule-xdt commented 1 week ago

Prerequisites

What happened?

I am integrating IX Modal component in React application, Modal is getting open using "showModal" method but as per given in example I am trying to close this but somehow getting exeption.

I have coded like this : let modalRef = useRef(null); const dismiss = () => { try { modalRef.current.dismiss(); } catch (e) { } };

Exception : TypeError: Cannot read properties of null (reading 'id')

What type of frontend framework are you seeing the problem on?

React

Which version of iX do you use?

2.1.2

Code to produce this issue.

let modalRef = useRef<ModalRef>(null);
const dismiss = () => {
        try {
            modalRef.current.dismiss();
        } catch (e) {
        }
    };