Merge pull request 'Padding for tooltips, preserving linebreaks in descriptions, not closing autocompletes on click' (#1521) from glossing/strudel:glossing/tooltip-padding-and-paragraphs into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1521
This commit is contained in:
commit
06ebcbff8c
2 changed files with 21 additions and 11 deletions
|
|
@ -56,11 +56,13 @@ const buildExamples = (examples) =>
|
|||
|
||||
export const Autocomplete = ({ doc, label }) =>
|
||||
h`
|
||||
<div class="autocomplete-info-tooltip">
|
||||
<h3 class="autocomplete-info-function-name">${label || getDocLabel(doc)}</h3>
|
||||
${doc.description ? `<p class="autocomplete-info-function-description">${doc.description}</p>` : ''}
|
||||
${buildParamsList(doc.params)}
|
||||
${buildExamples(doc.examples)}
|
||||
<div class="autocomplete-info-container">
|
||||
<div class="autocomplete-info-tooltip">
|
||||
<h3 class="autocomplete-info-function-name">${label || getDocLabel(doc)}</h3>
|
||||
${doc.description ? `<div class="autocomplete-info-function-description">${doc.description}</div>` : ''}
|
||||
${buildParamsList(doc.params)}
|
||||
${buildExamples(doc.examples)}
|
||||
</div>
|
||||
</div>
|
||||
`[0];
|
||||
|
||||
|
|
@ -98,4 +100,4 @@ export const strudelAutocomplete = (context) => {
|
|||
};
|
||||
|
||||
export const isAutoCompletionEnabled = (enabled) =>
|
||||
enabled ? [autocompletion({ override: [strudelAutocomplete] })] : [];
|
||||
enabled ? [autocompletion({ override: [strudelAutocomplete], closeOnBlur: false })] : [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue