Commit 150f8e4d authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'nicolasdular/fix-other-role-select-js-error' into 'master'

Fix JS error on welcome page

See merge request gitlab-org/gitlab!52022
parents 09210823 7e8bc64c
......@@ -20,7 +20,6 @@
.form-group.col-sm-12.js-other-role-group{ class: ("hidden") }
= f.label :other_role, _('What is your job title? (optional)'), class: 'form-check-label gl-mb-3'
= f.text_field :other_role, class: 'form-control'
- else
.row
.form-group.col-sm-12
.form-text.gl-text-gray-500.gl-mt-0.gl-line-height-normal.gl-px-1= _('This will help us personalize your onboarding experience.')
......
const role = document.querySelector('.js-user-role-dropdown');
const otherRoleGroup = document.querySelector('.js-other-role-group');
role.addEventListener('change', () => {
const enableOtherRole = role.value === 'other';
if (otherRoleGroup) {
const role = document.querySelector('.js-user-role-dropdown');
otherRoleGroup.classList.toggle('hidden', !enableOtherRole);
});
const showOtherRoleGroup = () => {
const enableOtherRole = role.value === 'other';
otherRoleGroup.classList.toggle('hidden', !enableOtherRole);
};
role.dispatchEvent(new Event('change'));
role.addEventListener('change', showOtherRoleGroup);
showOtherRoleGroup();
}
---
title: Fix JS error on welcome page
merge_request: 52022
author:
type: fixed
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