fix: Conditional slot rendering for use in modals
What does this MR do?
In gitlab!46055 (merged) we discovered that when we use GlFormInputGroup
in a modal with a copy button inside the <template #append>
, the copy button is visible when the modal is opened the first time, but it is no longer there when the modal is opened a second time.
Using v-if="$scopedSlots.append"
instead of v-if="$slots.append"
in GlFormInputGroup
makes it so the contents of the the <template #append>
is visible no matter how many times the modal is opened and closed.
The empty state component's #description
slot and the #help
slots in checkboxes and radio groups are conditionally rendered in the same way, so if we use them in modals in the future, this MR also helps us not to run into the same problem again.
Does this MR meet the acceptance criteria?
Conformity
-
Code review guidelines. -
GitLab UI's contributing guidlines. -
If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer. -
If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer. -
If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui
package can be upgraded quickly after the changes are released:-
GitLab: mr_url -
Customers Portal: mr_url -
Status Page: mr_url
-
-
Added the ~"component:*"
label(s) if applicable.
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
Security reports checked/validated by a reviewer from the AppSec team