@@ -4,21 +4,23 @@ document.addEventListener('DOMContentLoaded', () => {
4
4
5
5
searchInput . addEventListener ( 'input' , ( ) => {
6
6
const query = searchInput . value . toLowerCase ( ) ;
7
- const rows = reactionListBody . getElementsByTagName ( 'tr' ) ; // Only get rows from tbody
7
+ const rows = reactionListBody . getElementsByTagName ( 'tr' ) ;
8
8
9
9
Array . from ( rows ) . forEach ( row => {
10
- // Check if the row is currently visible
11
- if ( row . style . display !== 'none' ) {
12
- const name = row . cells [ 1 ] . textContent . toLowerCase ( ) ;
13
- const subsystem = row . cells [ 2 ] . textContent . toLowerCase ( ) ;
14
- const substrates = row . cells [ 3 ] . textContent . toLowerCase ( ) ;
15
- const products = row . cells [ 4 ] . textContent . toLowerCase ( ) ;
10
+ const name = row . cells [ 1 ] . textContent . toLowerCase ( ) ;
11
+ const subsystem = row . cells [ 2 ] . textContent . toLowerCase ( ) ;
12
+ const substrates = row . cells [ 3 ] . textContent . toLowerCase ( ) ;
13
+ const products = row . cells [ 4 ] . textContent . toLowerCase ( ) ;
16
14
17
- if ( name . includes ( query ) || subsystem . includes ( query ) || substrates . includes ( query ) || products . includes ( query ) ) {
18
- row . style . display = '' ; // Show row
19
- } else {
20
- row . style . display = 'none' ; // Hide row
21
- }
15
+ if (
16
+ name . includes ( query ) ||
17
+ subsystem . includes ( query ) ||
18
+ substrates . includes ( query ) ||
19
+ products . includes ( query )
20
+ ) {
21
+ row . style . display = '' ; // Show row
22
+ } else {
23
+ row . style . display = 'none' ; // Hide row
22
24
}
23
25
} ) ;
24
26
} ) ;
0 commit comments