Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ The CP has two parallel rendering stacks that are actively being consolidated:
components in `resources/js/common/`. `HandleInertiaRequests` middleware provides shared CP config, navigation, and
global props to all Inertia pages. The root Blade template is `resources/views/app.blade.php`.

VueUse (`@vueuse/core`) is installed — before hand-rolling composable behavior in Vue code (event listeners with
mount/unmount cleanup, media queries, storage, observers, etc.), check whether a VueUse utility already covers it
(e.g. `useEventListener` accepts ref targets and cleans up automatically, `useMediaQuery`).

**Legacy jQuery (old):** `resources/js/legacy.ts` loads the old surface. The individual jQuery modules live in
`packages/craftcms-legacy/` and are bundled with webpack (separate from Vite). Pages still on this stack return `view()`
from their controllers.
Expand Down
1 change: 0 additions & 1 deletion packages/craftcms-legacy/cp/src/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import './js/LightSwitch.js';
import './js/LinkField.js';
import './js/LinkInput.js';
import './js/LivePreview.js';
import './js/NestedElementManager.js';
import './js/PasswordInput.js';
import './js/Preview.js';
import './js/PreviewFileModal.js';
Expand Down
7 changes: 7 additions & 0 deletions packages/craftcms-legacy/cp/src/js/CraftElementLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class CraftElementLabel extends HTMLElement {
}

update() {
// Bail while the label isn't measurable (e.g. before a containing web
// component's first shadow render assigns its slots) — a 0-width label
// would always register as overflowing.
if (this.scrollWidth === 0) {
return;
}

this.desiredWidth = this.calculateWidth(this.innerText);
this.hasOverflow = this.desiredWidth > this.scrollWidth;

Expand Down
Loading
Loading