Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit 6e2aac1

Browse files
guguMatt Goo
authored andcommitted
fix(select): className option is passed to select and overrides selectClassName (#872)
1 parent 40ca635 commit 6e2aac1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/select/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ export default class Select<
343343
const {
344344
selectClassName,
345345
/* eslint-disable */
346+
className,
346347
floatingLabelClassName,
347348
lineRippleClassName,
348349
notchedOutlineClassName,

test/unit/select/index.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,16 @@ test('renders BaseSelect for select', () => {
403403
);
404404
});
405405

406+
test('does not pass className to BaseSelect', () => {
407+
const wrapper = shallow(<Select label='my label' className="container-class" />);
408+
assert.equal(wrapper.childAt(0).childAt(1).prop('className'), "");
409+
});
410+
411+
test('pass selectClassName to BaseSelect', () => {
412+
const wrapper = shallow(<Select label='my label' selectClassName="select-class" />);
413+
assert.equal(wrapper.childAt(0).childAt(1).prop('className'), "select-class");
414+
});
415+
406416
test('renders FloatingLabel after BaseSelect if props.label exists', () => {
407417
const wrapper = shallow(<Select label='my label' />);
408418
assert.equal(

0 commit comments

Comments
 (0)