Support validation directive for radio group
We have this wonderful validation directive > https://gitlab.com/gitlab-org/gitlab/blob/35a069ae43f54577632b6d7f8bb9cc8125445b87/app/assets/javascripts/vue_shared/directives/validation.js#L1
Unfortunately, at this time it doesn't support radio groups:
// currently this doesn't work
<gl-form-radio-group
v-model="form.fields.visibility.value"
v-validation:[form.showValidation]
data-testid="fork-visibility-radio-group"
name="visibility"
required
>
Well, let's change this and ensure our validation directive can support radio group
More info
The following discussion from !55838 (merged) should be addressed:
-
@dpisek started a discussion: question: unfortunately the validation directive doesn't work on
gl-form-radio-group
, as it needs to be added to an actual form element (input
,select
, etc.) but here it would receive adiv
. You would see something like this in the console:That's because a
div
technically can't have a name attribute.
Edited by Samantha Ming