diff --git a/CHANGELOG.md b/CHANGELOG.md
index b2ec62e..62eff29 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- **Input** — `leadingSlot` and `trailingSlot` now reserve room in the field, so their content no longer sits on top of the text, and pointer events reach them, so a button placed in a slot is clickable. A decorative `leadingIcon` or `trailingIcon` stays click through, and slot content is inert while the field is disabled or loading. The loading spinner also takes precedence over a slot instead of being swallowed by it. ([#229](https://github.com/ndlabdev/sv5ui/issues/229))
- **Table** — the column resize handle is a focusable `separator` with `aria-valuenow`, arrow key resizing and a larger step while shift is held, plus `Home` and `End` for the bounds. It was mouse only before: no role, no tabindex and no key handler, so keyboard users could not resize a column at all. The drag also moves to the shared pointer hook, so touch and pen work rather than mouse alone. ([#226](https://github.com/ndlabdev/sv5ui/issues/226))
- **ThemeModeButton** — renders both mode icons and lets CSS pick the visible one, so server and client markup are identical. The wrong glyph no longer sticks after a reload in dark mode. The accessible name is now a mode-independent `Toggle theme`. ([#224](https://github.com/ndlabdev/sv5ui/issues/224))
- **Modal**, **Slideover**, **Drawer**, **Popover** — with `portal={false}`, nested floating layers (Select, DatePicker, DropdownMenu, Tooltip, ...) no longer hide behind the container when an ancestor has a `z-index` above 50. ([#217](https://github.com/ndlabdev/sv5ui/issues/217))
diff --git a/src/lib/components/Input/Input.svelte b/src/lib/components/Input/Input.svelte
index 41cb999..d05fb0c 100644
--- a/src/lib/components/Input/Input.svelte
+++ b/src/lib/components/Input/Input.svelte
@@ -97,8 +97,15 @@
const loadingLeading = $derived(loading && !trailing)
const loadingTrailing = $derived(loading && trailing)
- const isLeading = $derived((!!icon && !trailing) || !!leadingIcon || !!avatar || loadingLeading)
- const isTrailing = $derived((!!icon && trailing) || !!trailingIcon || loadingTrailing)
+ const isInert = $derived(disabled || loading)
+ const leadingInteractive = $derived(!!leadingSlot && !isInert)
+ const trailingInteractive = $derived(!!trailingSlot && !isInert)
+ const isLeading = $derived(
+ !!leadingSlot || (!!icon && !trailing) || !!leadingIcon || !!avatar || loadingLeading
+ )
+ const isTrailing = $derived(
+ !!trailingSlot || (!!icon && trailing) || !!trailingIcon || loadingTrailing
+ )
const leadingIconName = $derived(leadingIcon || (!!icon && !trailing ? icon : undefined))
const trailingIconName = $derived(trailingIcon || (!!icon && trailing ? icon : undefined))
@@ -128,7 +135,9 @@
base: variantSlots.base({
class: [config.slots.base, fieldGroupClass?.base, ui?.base]
}),
- leading: variantSlots.leading({ class: [config.slots.leading, ui?.leading] }),
+ leading: variantSlots.leading({
+ class: [config.slots.leading, leadingInteractive && 'pointer-events-auto', ui?.leading]
+ }),
leadingIcon: variantSlots.leadingIcon({
class: [config.slots.leadingIcon, ui?.leadingIcon]
}),
@@ -136,7 +145,13 @@
class: [config.slots.leadingAvatar, ui?.leadingAvatar]
}),
leadingAvatarSize: variantSlots.leadingAvatarSize() as AvatarSize,
- trailing: variantSlots.trailing({ class: [config.slots.trailing, ui?.trailing] }),
+ trailing: variantSlots.trailing({
+ class: [
+ config.slots.trailing,
+ trailingInteractive && 'pointer-events-auto',
+ ui?.trailing
+ ]
+ }),
trailingIcon: variantSlots.trailingIcon({
class: [config.slots.trailingIcon, ui?.trailingIcon]
})
@@ -144,16 +159,16 @@