Commit 9e2a2cec authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'peterhegman/fix-allowed-email-domain-console-errors' into 'master'

Fix console error caused by missing mount element

See merge request gitlab-org/gitlab!57429
parents f0f0f6b3 314f1e1d
......@@ -2,7 +2,11 @@ import Vue from 'vue';
import { __, sprintf } from '~/locale';
import CommaSeparatedListTokenSelector from '../components/comma_separated_list_token_selector.vue';
export default (el, props = {}, qaSelector, customValidator) => {
export default (selector, props = {}, qaSelector, customValidator) => {
const el = document.querySelector(selector);
if (!el) return;
// eslint-disable-next-line no-new
new Vue({
el,
......@@ -10,9 +14,7 @@ export default (el, props = {}, qaSelector, customValidator) => {
CommaSeparatedListTokenSelector,
},
data() {
const { hiddenInputId, labelId, regexValidator, disallowedValues } = document.querySelector(
this.$options.el,
).dataset;
const { hiddenInputId, labelId, regexValidator, disallowedValues } = el.dataset;
return {
hiddenInputId,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment