Skip to content

Commit

Permalink
Merge pull request #1581 from themeum/settings-scroll-fix
Browse files Browse the repository at this point in the history
Settings scroll to view in search issue fixed
  • Loading branch information
shewa12 authored Feb 10, 2025
2 parents 3e57a8d + 1afee78 commit d1a368a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions assets/react/admin-dashboard/segments/options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { get_response_message } from '../../helper/response';

// SVG Icons Totor V2
Expand Down Expand Up @@ -384,15 +383,14 @@ document.addEventListener('DOMContentLoaded', function () {
function highlightSearchedItem(dataKey) {
const target = document.querySelector(`#${dataKey}`);
const targetEl = target && target.querySelector(`[tutor-option-name]`);
const scrollTargetEl = target && target.parentNode.querySelector('.tutor-option-field-row');

if (scrollTargetEl) {
if (targetEl) {
targetEl.classList.add('isHighlighted');
setTimeout(() => {
targetEl.classList.remove('isHighlighted');
}, 6000);

scrollTargetEl.scrollIntoView({
targetEl.scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'nearest',
Expand Down

0 comments on commit d1a368a

Please sign in to comment.