bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.3k stars 183 forks source link

NavLink inside DropdownItem gets bigger than usual text element #413

Closed JandosKh closed 2 years ago

JandosKh commented 2 years ago

I have the following navbar:

<Navbar color="light" light expand="md">
    <NavbarBrand href="/">Ledgerkit</NavbarBrand>
    <NavbarToggler on:click={() => (isOpen = !isOpen)} />
    <Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
        <Nav class="me-auto" navbar>
            <Dropdown nav inNavbar>
                <DropdownToggle nav caret>File</DropdownToggle>
                <DropdownMenu end>
                    <DropdownItem >
                        Select company
                    </DropdownItem>
                    <DropdownItem>
                        <NavLink href="/admin/createCompany">Create company</NavLink>        
                    </DropdownItem>
                </DropdownMenu>
            </Dropdown>
        </Nav>
    </Collapse>
</Navbar>

Style of the second dropdown item is different from the first one. What is proper way of putting a link inside DropdownItem?

JandosKh commented 2 years ago

Looking into the source code I found DropdownItem has href attribute. Closing this issue.