Skip to content

Commit 962204b

Browse files
authored
Merge branch 'alibaba-fusion:master' into master
2 parents 6ecdd86 + b825244 commit 962204b

File tree

8 files changed

+87
-7
lines changed

8 files changed

+87
-7
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## [1.27.33](https://github.com/alibaba-fusion/next/compare/1.27.30...1.27.33) (2025-12-01)
4+
5+
6+
### Bug Fixes
7+
8+
* **Drawer:** ensure correct padding-right is applied to body when Drawer is opened with scroll ([ae24d96](https://github.com/alibaba-fusion/next/commit/ae24d96f861c64ecd8bf7cf711a72e949626759a))
9+
* fix the type inference error on the consumer side ([#5030](https://github.com/alibaba-fusion/next/issues/5030)) ([86b98cf](https://github.com/alibaba-fusion/next/commit/86b98cfca3e3b67ad2c6dedd8c8c6eb1f3af7c50))
10+
* **TreeSelect:** fix expandedKeys bug when search by searchValue is empty and treeDefaultExpandAll is true ([872eaf1](https://github.com/alibaba-fusion/next/commit/872eaf1c428bc609ba71e69cd1fd55e7e1ba7113))
11+
12+
313
## [1.27.32](https://github.com/alibaba-fusion/next/compare/1.27.30...1.27.32) (2025-03-10)
414

515

LATESTLOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Latest Log
22

3-
## [1.27.32](https://github.com/alibaba-fusion/next/compare/1.27.30...1.27.32) (2025-03-10)
3+
## [1.27.33](https://github.com/alibaba-fusion/next/compare/1.27.30...1.27.33) (2025-12-01)
44

55

66
### Bug Fixes
77

8-
* **Field:** fix use setError on uninitialized field caused incorrect values configuration ([3f402b6](https://github.com/alibaba-fusion/next/commit/3f402b63540e2091fe6efaab9414272334641266))
9-
* **Nav:** the icon is not centered when the width of Nav in iconOnly mode is less than the default width ([bb46a4d](https://github.com/alibaba-fusion/next/commit/bb46a4d9d939b0b67d5dbee9722fb54fe16adfe7))
10-
* **TimePicker2:** support set locale by ConfigProvider ([a5e1284](https://github.com/alibaba-fusion/next/commit/a5e1284c30410d372a2fe71d02f857e8dc9027e7))
8+
* **Drawer:** ensure correct padding-right is applied to body when Drawer is opened with scroll ([ae24d96](https://github.com/alibaba-fusion/next/commit/ae24d96f861c64ecd8bf7cf711a72e949626759a))
9+
* fix the type inference error on the consumer side ([#5030](https://github.com/alibaba-fusion/next/issues/5030)) ([86b98cf](https://github.com/alibaba-fusion/next/commit/86b98cfca3e3b67ad2c6dedd8c8c6eb1f3af7c50))
10+
* **TreeSelect:** fix expandedKeys bug when search by searchValue is empty and treeDefaultExpandAll is true ([872eaf1](https://github.com/alibaba-fusion/next/commit/872eaf1c428bc609ba71e69cd1fd55e7e1ba7113))
1111

components/drawer/__tests__/index-v2-spec.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,46 @@ describe('Drawer v2', () => {
105105
hide();
106106
});
107107
});
108+
it('should add paddingRight to body when body is scroll on open Drawer', () => {
109+
let tallDiv: HTMLDivElement;
110+
111+
// 创建一个高元素使 body 产生滚动条
112+
cy.document().then(doc => {
113+
tallDiv = doc.createElement('div');
114+
tallDiv.style.height = '110vh';
115+
tallDiv.setAttribute('data-test-element', 'scroll-trigger'); // 添加标识方便查找
116+
doc.body.appendChild(tallDiv);
117+
});
118+
119+
// 设置初始 padding-right
120+
cy.get('body').invoke('css', 'padding-right', '10px');
121+
cy.get('body').invoke('css', 'overflow', 'auto');
122+
123+
cy.mount(
124+
<Drawer v2 visible title="test" closeMode={[]}>
125+
body
126+
</Drawer>
127+
);
128+
129+
cy.then(() => {
130+
const scrollDiv = document.createElement('div');
131+
scrollDiv.className = 'just-to-get-scrollbar-size';
132+
scrollDiv.style.width = '100px';
133+
scrollDiv.style.height = '100px';
134+
scrollDiv.style.overflow = 'scroll';
135+
scrollDiv.style.position = 'absolute';
136+
scrollDiv.style.top = '-9999px';
137+
document.body.appendChild(scrollDiv);
138+
const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
139+
document.body.removeChild(scrollDiv);
140+
cy.get('body').should('have.css', 'padding-right', `${10 + scrollbarWidth}px`);
141+
});
142+
143+
// 清理添加的元素
144+
cy.then(() => {
145+
if (tallDiv && tallDiv.parentNode) {
146+
tallDiv.parentNode.removeChild(tallDiv);
147+
}
148+
});
149+
});
108150
});

components/drawer/drawer-v2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const Drawer = (props: DrawerV2Props) => {
145145
const scrollWidth = dom.scrollbar().width;
146146
if (scrollWidth) {
147147
style.paddingRight = `${
148-
dom.getStyle(document.body, 'paddingRight').toString() +
148+
(dom.getStyle(document.body, 'paddingRight') as number) +
149149
dom.scrollbar().width
150150
}px`;
151151
}

components/tree-select/__tests__/index-spec.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,28 @@ describe('TreeSelect', () => {
929929
cy.contains('.next-select-values', '服装/男装');
930930
});
931931

932+
it('should expandedAll when search by searchValue is empty and treeDefaultExpandAll is true', () => {
933+
const searchedValue = '外套';
934+
const handleSearch = cy.spy();
935+
936+
cy.mount(
937+
<TreeSelect
938+
defaultVisible
939+
treeDefaultExpandAll
940+
dataSource={dataSource}
941+
showSearch
942+
onSearch={debounce(handleSearch, 20)} // Debounce for simulate Cypress action type below
943+
/>
944+
);
945+
cy.get('.next-select-trigger-search input').type(searchedValue);
946+
cy.get('.next-tree-node').then($el => {
947+
const list = $el.filter('[style!="display: none;"]');
948+
cy.wrap(list).should('have.length', 3);
949+
});
950+
cy.get('.next-select-trigger-search input').clear();
951+
cy.get('.next-tree-node').should('have.length', 6);
952+
});
953+
932954
describe('should support useDetailValue', () => {
933955
it('Support dataSource mode', () => {
934956
const handleChange = cy.spy();

components/tree-select/tree-select.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,12 @@ class TreeSelect extends Component<TreeSelectProps, TreeSelectState> {
774774
notFound = true;
775775
}
776776
} else {
777+
// 如过 filterLocal 并且 showSearch 但是没有 searchedValue 的时候,也需要设置 expandedKeys
778+
if (filterLocal && showSearch) {
779+
treeProps.expandedKeys = expandedKeys;
780+
treeProps.autoExpandParent = autoExpandParent;
781+
treeProps.onExpand = this.handleExpand;
782+
}
777783
// eslint-disable-next-line
778784
if (dataSource) {
779785
if (dataSource.length) {

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var next = require('./lib/index.js');
22

3-
next.version = '1.27.32';
3+
next.version = '1.27.33';
44

55
module.exports = next;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alifd/next",
3-
"version": "1.27.32",
3+
"version": "1.27.33",
44
"description": "A configurable component library for web built on React.",
55
"keywords": [
66
"fusion",

0 commit comments

Comments
 (0)