Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stray space before popover and tooltip #2486

Merged
merged 7 commits into from
Apr 4, 2024
Merged
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 packages/cli/test/functional/test_site/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,10 @@ <h2 id="panel-header-inside-unexpanded-panel-should-not-appear-in-search-data">P
Some text some text some text some text some text some text some text. Some text some text some text some text some text some text some text. Some text some text some text some text some text some text some text some text some text some text some text some text some text some text. Some text some text some text some text some text some text. Some text some text some text some text some text some text some text.
</panel>
</div>
<p><strong>Test popover has no stray space</strong>
(<popover><template #content>content</template>There should be no stray space before this</popover>)</p>
<p><strong>Test tooltip has no stray space</strong>
(<tooltip><template #content>content</template>There should be no stray space before this</tooltip>)</p>
<p><strong>Test search indexing</strong></p>
<p><strong>Test PlantUML live reload without include</strong></p>
<pic src="/test_site/diagrams/activity.png" alt="activity diagram"></pic>
Expand Down

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions packages/cli/test/functional/test_site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ and **this**.
**Test panel closing transitions**
<include src="testPanelsClosingTransition.md" />

**Test popover has no stray space**
(<popover content="content">There should be no stray space before this</popover>)

**Test tooltip has no stray space**
(<tooltip content="content">There should be no stray space before this</tooltip>)

**Test search indexing**

Expand Down
5 changes: 2 additions & 3 deletions packages/vue-components/src/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
<div class="popover-body">
<slot name="content"></slot>
</div>
</portal>

<v-popover
</portal><!-- do not delete this comment, it is for the stray space issue (#2419)
--><v-popover
v-if="isMounted"
:auto-hide="!isInput"
:triggers="triggers"
Expand Down
10 changes: 4 additions & 6 deletions packages/vue-components/src/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
>
<portal v-if="targetEl.id" :to="'tooltip:' + targetEl.id">
<slot name="content"></slot>
</portal>

<v-tooltip
</portal><!-- do not delete this comment, it is for the stray space issue (#2419)
--><v-tooltip
v-if="isMounted"
:auto-hide="!isInput"
:triggers="triggers"
Expand All @@ -20,9 +19,8 @@
>
<template #popper>
<slot name="content"></slot>
</template>

<span v-if="!isInput" @click.stop>
</template><!-- do not delete this comment, it is for the stray space issue (#2419)
--><span v-if="!isInput" @click.stop>
<slot></slot>
</span>
<slot v-else></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Popover should not be shown until triggered 1`] = `
tabindex="0"
>
<!---->

<!---->
</span>
`;
Expand All @@ -21,7 +20,6 @@ exports[`Popover should not show header when no header is given 1`] = `
tabindex="0"
>
<!---->

<v-popover-stub
auto-hide="true"
delay="0"
Expand All @@ -47,7 +45,6 @@ exports[`Popover should respect the placement attribute 1`] = `
tabindex="0"
>
<!---->

<v-popover-stub
auto-hide="true"
delay="0"
Expand All @@ -73,7 +70,6 @@ exports[`Popover should show header and content 1`] = `
tabindex="0"
>
<!---->

<v-popover-stub
auto-hide="true"
delay="0"
Expand All @@ -97,7 +93,6 @@ exports[`Popover should show header and content slots correctly 1`] = `
tabindex="0"
>
<!---->

<v-popover-stub
auto-hide="true"
delay="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Tooltip should not be shown until triggered 1`] = `
tabindex="0"
>
<!---->

<!---->
</span>
`;
Expand All @@ -21,7 +20,6 @@ exports[`Tooltip should respect the placement attribute 1`] = `
tabindex="0"
>
<!---->

<v-tooltip-stub
auto-hide="true"
delay="0"
Expand All @@ -31,7 +29,6 @@ exports[`Tooltip should respect the placement attribute 1`] = `
shift-cross-axis=""
triggers="click"
>

<span>
click to show tooltip
</span>
Expand All @@ -47,7 +44,6 @@ exports[`Tooltip should show contents correctly when triggered 1`] = `
tabindex="0"
>
<!---->

<v-tooltip-stub
auto-hide="true"
delay="0"
Expand All @@ -57,7 +53,6 @@ exports[`Tooltip should show contents correctly when triggered 1`] = `
shift-cross-axis=""
triggers="click"
>

<span>
click to show tooltip
</span>
Expand Down
Loading