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 ClassName Fix #3845

Merged
merged 2 commits into from
Oct 24, 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
8 changes: 4 additions & 4 deletions playbook/app/pb_kits/playbook/pb_dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@import "./scss_partials/dropdown_animation";

.pb_dropdown {
[class*="pb_dropdown"] {
.dropdown_wrapper {
[class*="dropdown_trigger_wrapper"] {
@include pb_body;
Expand Down Expand Up @@ -131,7 +131,7 @@
}
}

&.separators_hidden {
&[class*="separators_hidden"] {
.dropdown_wrapper {
.pb_dropdown_container {

Expand All @@ -142,7 +142,7 @@
}
}

&.subtle {
&[class*="subtle"] {
.dropdown_wrapper {
.pb_dropdown_container {

Expand Down Expand Up @@ -178,7 +178,7 @@
}
}

&.separators_hidden {
&[class*="separators_hidden"] {
.dropdown_wrapper {
.pb_dropdown_container {
[class*="pb_dropdown_option"]:first-child {
Expand Down
4 changes: 1 addition & 3 deletions playbook/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
const htmlProps = buildHtmlProps(htmlOptions);
const separatorsClass = separators ? '' : 'separators_hidden'
const classes = classnames(
buildCss("pb_dropdown"),
buildCss("pb_dropdown", variant, separatorsClass),
globalProps(props),
variant,
separatorsClass,
className
);

Expand Down
4 changes: 2 additions & 2 deletions playbook/app/pb_kits/playbook/pb_dropdown/dropdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def data
end

def classname
generate_classname("pb_dropdown", variant, separators_class, separator: " ")
generate_classname("pb_dropdown", variant, separators_class)
end

private
Expand All @@ -38,7 +38,7 @@ def input_default_value
end

def separators_class
separators ? "" : "separators_hidden"
separators ? nil : "separators_hidden"
end

def options_with_blank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('generated default kit and classname', () => {

const kit = screen.getByTestId(testId)
expect(kit).toBeInTheDocument()
expect(kit).toHaveClass('pb_dropdown')
expect(kit).toHaveClass('pb_dropdown_default')
})

test('generated default Trigger and Container when none passed in', () => {
Expand Down
Loading