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'; ...@@ -2,7 +2,11 @@ import Vue from 'vue';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import CommaSeparatedListTokenSelector from '../components/comma_separated_list_token_selector.vue'; 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 // eslint-disable-next-line no-new
new Vue({ new Vue({
el, el,
...@@ -10,9 +14,7 @@ export default (el, props = {}, qaSelector, customValidator) => { ...@@ -10,9 +14,7 @@ export default (el, props = {}, qaSelector, customValidator) => {
CommaSeparatedListTokenSelector, CommaSeparatedListTokenSelector,
}, },
data() { data() {
const { hiddenInputId, labelId, regexValidator, disallowedValues } = document.querySelector( const { hiddenInputId, labelId, regexValidator, disallowedValues } = el.dataset;
this.$options.el,
).dataset;
return { return {
hiddenInputId, 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