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

Dropdown update #459

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/DropdownItem.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SvelteComponentTyped } from 'svelte';

export interface DropdownItemProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['button']> {
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['li']> {
active?: boolean;
disabled?: boolean;
divider?: boolean;
Expand Down
2 changes: 2 additions & 0 deletions src/DropdownItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
}
</script>

<li>
{#if header}
<h6 {...$$restProps} on:click on:click={handleItemClick} class={classes}>
<slot />
Expand All @@ -51,3 +52,4 @@
<slot />
</button>
{/if}
</li>
2 changes: 1 addition & 1 deletion src/DropdownMenu.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SvelteComponentTyped } from 'svelte';

export interface DropdownMenuProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['div']> {
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['ul']> {
dark?: boolean;
end?: boolean;
right?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/DropdownMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
});
</script>

<div
<ul
{...$$restProps}
class={classes}
data-bs-popper={$context.inNavbar ? 'static' : undefined}
use:$context.popperContent={popperOptions}
>
<slot />
</div>
</ul>
3 changes: 2 additions & 1 deletion src/DropdownToggle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
$: classes = classnames(className, {
'dropdown-toggle': caret || split,
'dropdown-toggle-split': split,
'nav-link': nav
'nav-link': nav,
'show' : $context.isOpen
});

function toggleButton(e) {
Expand Down
2 changes: 1 addition & 1 deletion src/Popover.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { onMount } from 'svelte';
import { createPopper } from '@popperjs/core/dist/esm/popper';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, the rest of this PR looks good, however changing this line causes issues in svelte repl and in sapper last I checked. Is this necessary to change this?

import { createPopper } from '@popperjs/core';
import classnames from './utils';
import InlineContainer from './InlineContainer.svelte';
import Portal from './Portal.svelte';
Expand Down