Skip to content

Commit adc61c5

Browse files
authored
Remove jQuery .attr from the user search box (#29919)
- Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the user search box and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com>
1 parent dd04385 commit adc61c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

web_src/js/features/comp/SearchUserBox.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ const {appSubUrl} = window.config;
55
const looksLikeEmailAddressCheck = /^\S+@\S+$/;
66

77
export function initCompSearchUserBox() {
8-
const $searchUserBox = $('#search-user-box');
9-
const allowEmailInput = $searchUserBox.attr('data-allow-email') === 'true';
10-
const allowEmailDescription = $searchUserBox.attr('data-allow-email-description');
8+
const searchUserBox = document.getElementById('search-user-box');
9+
if (!searchUserBox) return;
10+
11+
const $searchUserBox = $(searchUserBox);
12+
const allowEmailInput = searchUserBox.getAttribute('data-allow-email') === 'true';
13+
const allowEmailDescription = searchUserBox.getAttribute('data-allow-email-description') ?? undefined;
1114
$searchUserBox.search({
1215
minCharacters: 2,
1316
apiSettings: {

0 commit comments

Comments
 (0)