Skip to content

Commit 4bf73a0

Browse files
committed
Fix rendering of multiple index signatures
As reported at #2567 (comment)
1 parent 13db5d4 commit 4bf73a0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/lib/output/themes/default/templates/reflection.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export function reflectionTemplate(context: DefaultThemeRenderContext, props: Pa
6767
{!!props.model.indexSignatures?.length && (
6868
<section class={classNames({ "tsd-panel": true }, context.getReflectionClasses(props.model))}>
6969
<h4 class="tsd-before-signature">{context.i18n.theme_indexable()}</h4>
70-
{props.model.indexSignatures.map((index) => renderIndexSignature(context, index))}
70+
<ul class="tsd-signatures">
71+
{props.model.indexSignatures.map((index) => renderIndexSignature(context, index))}
72+
</ul>
7173
</section>
7274
)}
7375
{!props.model.signatures && context.memberSources(props.model)}
@@ -81,7 +83,7 @@ export function reflectionTemplate(context: DefaultThemeRenderContext, props: Pa
8183

8284
function renderIndexSignature(context: DefaultThemeRenderContext, index: SignatureReflection) {
8385
return (
84-
<>
86+
<li class="tsd-index-signature">
8587
<div class="tsd-signature">
8688
<span class="tsd-signature-symbol">[</span>
8789
{index.parameters!.map((item) => (
@@ -95,6 +97,6 @@ function renderIndexSignature(context: DefaultThemeRenderContext, index: Signatu
9597
{context.commentSummary(index)}
9698
{context.commentTags(index)}
9799
{index.type instanceof ReflectionType && context.parameter(index.type.declaration)}
98-
</>
100+
</li>
99101
);
100102
}

static/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,12 @@ a.tsd-index-link {
10481048
border-width: 1px 0;
10491049
transition: background-color 0.1s;
10501050
}
1051+
.tsd-signatures .tsd-index-signature:not(:last-child) {
1052+
margin-bottom: 1em;
1053+
}
1054+
.tsd-signatures .tsd-index-signature .tsd-signature {
1055+
border-width: 1px;
1056+
}
10511057
.tsd-description .tsd-signatures .tsd-signature {
10521058
border-width: 1px;
10531059
}

0 commit comments

Comments
 (0)