Skip to content

Commit

Permalink
Do not collapse empty pane titles. Fix for #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Dec 8, 2023
1 parent 4b885da commit 4ae0d21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/examples/tests/TestTitlelessDraggable.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts">
import { Pane, Text } from '$lib';
let title = '';
let title2 = 'Title';
</script>

<a href="https://github.com/kitschpatrol/svelte-tweakpane-ui/issues/1">Issue #1</a>

<Pane position="draggable" {title} x={10} y={150}>
<Text bind:value={title} label="Pane Title" />
</Pane>

<Pane localStoreId={'B'} position="draggable" title={title2} x={10} y={220}>
<Text bind:value={title2} label="Pane Title" />
</Pane>
5 changes: 5 additions & 0 deletions src/lib/internal/InternalPaneDraggable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,11 @@ draggable-container"
/* stylelint-disable-next-line selector-class-pattern */
div.draggable-container :global(div.tp-rotv_t) {
cursor: grab;
overflow: hidden;
/* Ensure draggable hit zone does not collapse if title is missing */
/* Fixes #1 */
height: 100%;
text-overflow: ellipsis;
}
div.draggable-container.not-collapsable :global(div.tp-rotv_t) {
Expand Down

0 comments on commit 4ae0d21

Please sign in to comment.