Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2d61d98
chore: init
zombieJ Oct 9, 2025
597ecab
of it
zombieJ Oct 9, 2025
f1e9ff9
chore: of it
zombieJ Oct 10, 2025
4a6925f
chore: fill content
zombieJ Oct 10, 2025
2477daf
chore: style
zombieJ Oct 10, 2025
1c2573d
chore: style
zombieJ Oct 10, 2025
e1c5e34
chore: basic content
zombieJ Oct 10, 2025
d954431
chore: blur clear
zombieJ Oct 10, 2025
b14de98
chore: clear logic
zombieJ Oct 11, 2025
992b22d
chore: fit logic
zombieJ Oct 11, 2025
012e64f
chore: connect logic
zombieJ Oct 11, 2025
d78b95f
chore: fix logic
zombieJ Oct 11, 2025
70fa69f
chore: fix logic
zombieJ Oct 11, 2025
9e32905
chore: adjust omit position
zombieJ Oct 11, 2025
9e78943
chore: adjust omit position
zombieJ Oct 11, 2025
fe07192
chore: adjust omit position
zombieJ Oct 11, 2025
85b64f7
test: more test
zombieJ Oct 11, 2025
7f38025
chore: test config
zombieJ Oct 11, 2025
3ca6f16
chore: test config
zombieJ Oct 11, 2025
f9e8a2c
chore: adjust logic
zombieJ Oct 11, 2025
9a4d6d3
chore: backfill
zombieJ Oct 11, 2025
8101a4c
chore: lots of logic
zombieJ Oct 11, 2025
fcc578d
chore: lots of logic
zombieJ Oct 11, 2025
d04df92
chore: connect combobox
zombieJ Oct 11, 2025
341a834
test: fix test
zombieJ Oct 11, 2025
3f538ab
chore: add polit
zombieJ Oct 11, 2025
484c523
chore: mv code
zombieJ Oct 11, 2025
0a18a4f
chore: multiple
zombieJ Oct 11, 2025
1faca1f
chore: multiple of it
zombieJ Oct 11, 2025
211f982
chore: clean up
zombieJ Oct 13, 2025
5e712d1
chore: fix logic
zombieJ Oct 13, 2025
db75428
chore: fix logic
zombieJ Oct 13, 2025
c03a03e
test: batch update
zombieJ Oct 13, 2025
ef34813
test: batch update
zombieJ Oct 13, 2025
f71f4c5
fix: display logic
zombieJ Oct 13, 2025
afdf9c5
fix: display logic
zombieJ Oct 13, 2025
cf95331
test: update snapshot
zombieJ Oct 13, 2025
0ed8ae6
chore: more logic
zombieJ Oct 13, 2025
83cd06f
chore: more
zombieJ Oct 13, 2025
2b14e52
chore: more and more
zombieJ Oct 13, 2025
c91c43b
test: update snapshot
zombieJ Oct 13, 2025
8b2da80
test: update snapshot
zombieJ Oct 13, 2025
27e7b2c
test: base test
zombieJ Oct 13, 2025
04db275
chore: update
zombieJ Oct 13, 2025
de31413
chore: update
zombieJ Oct 13, 2025
648f73d
test: fix test
zombieJ Oct 13, 2025
3f98735
chore: adjust cls
zombieJ Oct 13, 2025
30bdebe
chore: multiple default search
zombieJ Oct 13, 2025
97bce99
chore: of it
zombieJ Oct 14, 2025
b606279
chore: of it
zombieJ Oct 14, 2025
4649241
test: all of multiple
zombieJ Oct 14, 2025
36220d3
chore: clean up
zombieJ Oct 14, 2025
e81f2f5
chore: adjust logic
zombieJ Oct 14, 2025
de3f3a6
chore: replace components
zombieJ Oct 14, 2025
a8ca6ec
chore: support components
zombieJ Oct 14, 2025
0ca69af
chore: of it
zombieJ Oct 14, 2025
370a165
chore: new logic of passing
zombieJ Oct 14, 2025
8234174
chore: fix input logic
zombieJ Oct 14, 2025
2cb9ad2
test: fix test
zombieJ Oct 14, 2025
97ee306
test: fix test
zombieJ Oct 14, 2025
7e86869
chore: fix combobox logic
zombieJ Oct 15, 2025
ff55f9a
chore: fix ref
zombieJ Oct 15, 2025
250d0c8
chore: all test
zombieJ Oct 15, 2025
a8d598c
chore: clean up
zombieJ Oct 15, 2025
7e2ffc6
chore: clean up
zombieJ Oct 15, 2025
d5f7692
chore: clean up
zombieJ Oct 15, 2025
2facc4e
chore: adjust import
zombieJ Oct 16, 2025
1428565
chore: rm useless file
zombieJ Oct 16, 2025
41ccbca
chore: clean up
zombieJ Oct 16, 2025
fd508bd
chore: clean up
zombieJ Oct 16, 2025
be51de6
test: coverage
zombieJ Oct 16, 2025
ff308c8
test: coverage
zombieJ Oct 16, 2025
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
1 change: 1 addition & 0 deletions assets/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@select-prefix: ~'rc-select';
@import url('./patch.less');

* {
box-sizing: border-box;
Expand Down
83 changes: 83 additions & 0 deletions assets/patch.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// This is used for semantic refactoring
@import (reference) url('./index.less');

.@{select-prefix}.@{select-prefix} {

Choose a reason for hiding this comment

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

medium

Using a duplicated class selector (.@{select-prefix}.@{select-prefix}) to increase specificity can be a bit of a hack and might make the CSS harder to maintain. If this is necessary to override existing styles, please add a comment explaining why. A better long-term solution might be to refactor the base styles to avoid needing such high specificity.

display: inline-flex;
align-items: center;
user-select: none;
border: 1px solid blue;

Choose a reason for hiding this comment

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

high

This appears to be a debugging style that was left in the code. It should be removed before merging.

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

移除或配置化硬编码的蓝色边框。

硬编码的 border: 1px solid blue; 看起来像是用于调试或演示目的。应该将其移除或改为可配置的变量,以便在生产环境中使用。

应用此差异移除硬编码边框:

   display: inline-flex;
   align-items: center;
   user-select: none;
-  border: 1px solid blue;
   position: relative;

或者使用变量:

-  border: 1px solid blue;
+  border: @select-border-width @select-border-style @select-border-color;
🤖 Prompt for AI Agents
In assets/patch.less around line 8 (line 8 only), there is a hard-coded debug
style "border: 1px solid blue;" — remove this hard-coded rule or replace it with
a configurable Less variable (e.g. use a border declaration that references a
variable like @patch-border or @debug-border with a sensible default or none)
and update your variables/settings file to define that variable; ensure any
consumers fallback when the variable is unset and remove any remaining
debug-only styling before production.

position: relative;

// Content 部分自动占据剩余宽度
.@{select-prefix}-content {
flex: auto;
display: flex;
align-items: center;
/* Prevent content from wrapping */
min-width: 0; /* allow flex item to shrink */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: relative;
}

.@{select-prefix}-input {
border: none;
background: transparent;
}

.@{select-prefix}-placeholder {
opacity: 0.5;

&::after {
content: '\00a0'; // nbsp placeholder
width: 0;
overflow: hidden;
}
}

.@{select-prefix}-content,
.@{select-prefix}-input,
.@{select-prefix}-placeholder {
padding: 0;
margin: 0;
line-height: 1.5;
font-size: 14px;
font-weight: normal;
}

// 其他部分禁止自动宽度,使用内容宽度
.@{select-prefix}-prefix,
.@{select-prefix}-suffix,
.@{select-prefix}-clear {
flex: none;
}

.@{select-prefix}-clear {
position: absolute;
top: 0;
right: 0;
}

// ============================= Single =============================
&-single {
.@{select-prefix}-input {
position: absolute;
inset: 0;
}
}

// ============================ Multiple ============================
&-multiple {
.@{select-prefix}-selection-item {
background: rgba(0, 0, 0, 0.1);
border-radius: 8px;
margin-right: 4px;
}

.@{select-prefix}-input {
width: calc(var(--select-input-width, 10) * 1px);
min-width: 4px;
}
}
}
1 change: 1 addition & 0 deletions docs/examples/multiple-with-maxCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Test: React.FC = () => {
<>
<h2>Multiple with maxCount</h2>
<Select
showSearch
maxCount={4}
mode="multiple"
value={value}
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/multiple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Test extends React.Component {
style={{ width: 500 }}
mode="multiple"
loading={loading}
suffixIcon={suffixIcon}
suffix={suffixIcon}
allowClear
optionFilterProp="children"
optionLabelProp="children"
Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
};
Loading
Loading