[go: up one dir, main page]

GlFormGroup description slot inside GlModal disappears second time GlModal appears

Summary

When you open the modal for the first time, the description appears in the <gl-form-group>. However, when you hit "Cancel" or "OK" and then open the modal again, the description disappears.

Note that this only happens when using <template #description> to populate the description. Everything works as expected when using description="Hello world" or :description="'Hello world'".

Steps to reproduce

  1. Paste the example code into any Vue application in GitLab
  2. Click "Open Modal"
  3. See the "Hello world" description
  4. Click "OK" or "Cancel"
  5. Click "Open Modal" again
  6. See that "Hello world" is gone

Example Project

Reproducing code:

<gl-link v-gl-modal-directive="'my-modal'">Open Modal</gl-link>
<gl-modal modal-id="my-modal">
  <gl-form-group>
    <template #description>Hello world</template>
    <gl-form-input v-model="stuff"/>
  </gl-form-group>
</gl-modal>

What is the current bug behavior?

Description disappears on opening modal for the second time.

What is the expected correct behavior?

Description is present no matter how many times the modal is opened.

Relevant logs and/or screenshots

Opening modal for the first time:

image

Opening modal subsequent times:

image

Typing input into the text field causes a re-render:

image

Possible fixes

The description renders properly when you type input into the text field, but only if it has the v-model.