impr: add inert property to disclosures for closed

This commit is contained in:
Xylight committed 2025-09-28 15:20:16 -07:00
1 parent fdcef736cf
commit 1f6fe23be5
4 files changed
+20 -11

No files matched your search

+3 -3
View File
@@ -165,7 +165,7 @@
{#if node.comment_view.creator_is_moderator} {#if node.comment_view.creator_is_moderator}
<Icon <Icon
src={ShieldCheck} src={ShieldCheck}
size="14" size="16"
micro micro
class="text-green-500" class="text-green-500"
aria-label={$t('class.moderator')} aria-label={$t('class.moderator')}
@@ -242,12 +242,12 @@
</label> </label>
{/if} {/if}
<input <input
class="hidden comment-expand" class="appearance-none absolute inset-0 pointer-events-none comment-expand"
type="checkbox" type="checkbox"
id="comment-expand-{node.comment_view.comment.id}" id="comment-expand-{node.comment_view.comment.id}"
bind:checked={open} bind:checked={open}
/> />
<div class={['expand max-w-full', contentClass]}> <div class={['expand max-w-full', contentClass]} inert={!open}>
<div id="comment-content"> <div id="comment-content">
<div <div
class={[ class={[
@@ -22,13 +22,18 @@
const id = $props.id() const id = $props.id()
</script> </script>
<div {...rest} class={['w-full', clazz]}> <div {...rest} class={['w-full relative', clazz]}>
<label for={id} class="w-full"> <label for={id} class="w-full">
{@render summary?.({ open })} {@render summary?.({ open })}
</label> </label>
{@render extended?.()} {@render extended?.()}
<input {id} class="hidden input" type="checkbox" bind:checked={open} /> <input
<div class="expand"> {id}
class="appearance-none absolute w-full h-full inset-0 pointer-events-none"
type="checkbox"
bind:checked={open}
/>
<div class="expand" inert={!open}>
{@render children?.({ open })} {@render children?.({ open })}
</div> </div>
</div> </div>
@@ -42,7 +47,7 @@
transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1); transition: grid-template-rows 0.5s cubic-bezier(0.19, 1, 0.22, 1);
} }
.input:checked + .expand { input:checked + .expand {
grid-template-rows: 1fr; grid-template-rows: 1fr;
} }
+1 -1
View File
@@ -94,7 +94,7 @@
> >
<div <div
bind:this={el} bind:this={el}
use:trapFocus use:trapFocus={true}
transition:scale|global={{ transition:scale|global={{
start: 0.97, start: 0.97,
easing: backOut, easing: backOut,
@@ -15,9 +15,11 @@
</script> </script>
{#snippet itemInfo()} {#snippet itemInfo()}
<Button color="primary" rounding="pill" class="w-max" href={item.link}> {#if item.link}
{$t('common.jump')} <Button color="primary" rounding="pill" class="w-max" href={item.link}>
</Button> {$t('common.jump')}
</Button>
{/if}
{#if item.moderatee} {#if item.moderatee}
<UserLink avatar user={item.moderatee} /> <UserLink avatar user={item.moderatee} />
{/if} {/if}
@@ -71,6 +73,8 @@
> >
{$t('common.info')} {$t('common.info')}
</Button> </Button>
{:else if item.moderatee}
<UserLink user={item.moderatee} />
{/if} {/if}
</td> </td>
</tr> </tr>