oruga icon indicating copy to clipboard operation
oruga copied to clipboard

Getting destroyOnHide prop for Modal to work

Open wishinghand opened this issue 3 years ago • 1 comments

Overview of the problem

Oruga version: [0.4.7] Vuejs version: [3.2.19] OS/Browser: Windows 10 64 bit/Firefox

Description

Modal's destroyOnHide prop doesn't seem to work

Steps to reproduce

  1. Programmatically call a modal with form and state like so:
oruga.modal.open({
    autoFocus: true,
    component: FormComponent,
    destroyOnHide: false,
});
  1. Type anything into a form
  2. Close modal in FormComponent using emit('close');
  3. Reopen modal
  4. Form fields in FormComponent are empty.

Expected behavior

For the Form fields in FormComponent to have the text persisted

Actual behavior

It seems that the Oruga modal is destroyed and renewed every time it's called, even with destroyOnHide: false in its config object.

wishinghand avatar Apr 06 '22 21:04 wishinghand

At the moment that prop works only with modal by tag and not programmatically

jtommy avatar Apr 20 '22 11:04 jtommy