fix: address code quality issues in category assignment modal
- Add btn--sm class to assign-categories button - Force DOM reflow in openModal() so CSS transition fires correctly - Clear treeEl.innerHTML at start of renderTree() to prevent stale tree on rapid double-click (race between two parallel fetch pairs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
<td>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn--secondary js-assign-categories"
|
||||
class="btn btn--secondary btn--sm js-assign-categories"
|
||||
data-integration-id="<?= $e((string) $integrationId) ?>"
|
||||
data-product-id="<?= $e((string) ($row['external_product_id'] ?? '')) ?>"
|
||||
>Przypisz kategorie</button>
|
||||
@@ -111,6 +111,7 @@
|
||||
|
||||
function openModal() {
|
||||
backdrop.style.display = '';
|
||||
backdrop.getBoundingClientRect(); // force reflow so CSS transition fires
|
||||
backdrop.setAttribute('aria-hidden', 'false');
|
||||
backdrop.classList.add('is-visible');
|
||||
loadingEl.style.display = '';
|
||||
@@ -224,6 +225,7 @@
|
||||
}
|
||||
|
||||
function renderTree(flat, checked) {
|
||||
treeEl.innerHTML = '';
|
||||
var roots = buildTree(flat);
|
||||
var ul = document.createElement('ul');
|
||||
ul.style.cssText = 'padding:0;margin:0';
|
||||
|
||||
Reference in New Issue
Block a user