Skip to content

Commit

Permalink
Remove jQuery .attr from the user search box (#29919)
Browse files Browse the repository at this point in the history
- Switched from jQuery `.attr` to plain javascript `.getAttribute`
- Tested the user search box and it works as before

Signed-off-by: Yarden Shoham <[email protected]>
  • Loading branch information
yardenshoham authored Mar 20, 2024
1 parent dd04385 commit adc61c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web_src/js/features/comp/SearchUserBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const {appSubUrl} = window.config;
const looksLikeEmailAddressCheck = /^\S+@\S+$/;

export function initCompSearchUserBox() {
const $searchUserBox = $('#search-user-box');
const allowEmailInput = $searchUserBox.attr('data-allow-email') === 'true';
const allowEmailDescription = $searchUserBox.attr('data-allow-email-description');
const searchUserBox = document.getElementById('search-user-box');
if (!searchUserBox) return;

const $searchUserBox = $(searchUserBox);
const allowEmailInput = searchUserBox.getAttribute('data-allow-email') === 'true';
const allowEmailDescription = searchUserBox.getAttribute('data-allow-email-description') ?? undefined;
$searchUserBox.search({
minCharacters: 2,
apiSettings: {
Expand Down

0 comments on commit adc61c5

Please sign in to comment.