Here are two hotfixes for the recent Datatable issue:
Add the following lines after the searchElement declaration:
const searchElement: HTMLInputElement | null = document.querySelector(`[data-datatable-search="#${tableId}"]`); // Get search state const { search } = this.getState(); // Set search value searchElement.value = typeof search === 'string' ? search : String(search);
This will fix the search input retains its value after refreshing the page.
Find this line:
const row = this._tbodyElement.insertRow();
Replace it with:
const row = this._tableElement.tBodies[0].insertRow();
This modification addresses the issue where the "infoEmpty" message does not display when the search is empty, so the message appears correctly.
These tweaks should help resolve the issues.