Skip to content

non-rounded borders for CDropdownToggle #455

@arikorn

Description

@arikorn

If a dropdown menu is made without the caret, only the left side of the toggler is rounded on hover (the darker background, here).

Image

This appears to be due to the first selector in the rule:

.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn.dropdown-toggle-split:first-child,
.btn-group > .btn-group:not(:last-child) > .btn {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

The problem is that in the standard order of coding dropdown menus:

		<CDropdown ...>
			<CDropdownToggle caret={false} ...>...</CDropdownToggle>
			<CDropdownMenu>...</CDropdownMenu>
		</CDropdown>

CDropdown, the parent, is a btn-group and it has two children and the toggler is the first one, but because caret={false}, the toggler is not assigned the class dropdown-toggle, so the selector is satisfied:

<div class="btn-group help-menu">
    <button class="btn btn-primary>...</button>
    <ul class="dropdown-menu">...</ul>
</div>

So it seems that there are two potential solutions:

I'm not sure of the consequences of each options, so am not posting this as a PR.

Also, as best as I can tell this is a recent problem, as it used to work correctly. [Edit: see next comment.]

Windows 11, Chrome, but this should be irrelevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions