mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-18 11:18:14 +08:00
fix: fix select rtl (#23235)
* fix: fix select rtl * fix lint Co-Authored-By: Amumu <yoyo837@hotmail.com> Co-authored-by: Amumu <yoyo837@hotmail.com>
This commit is contained in:
parent
c338569cff
commit
1855fef437
@ -28,8 +28,7 @@
|
|||||||
// ========================== Popup ==========================
|
// ========================== Popup ==========================
|
||||||
&-dropdown {
|
&-dropdown {
|
||||||
&-rtl {
|
&-rtl {
|
||||||
direction: ltr;
|
direction: rtl;
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ function initDocSearch(locale: string) {
|
|||||||
transformData(hits: { url: string }[]) {
|
transformData(hits: { url: string }[]) {
|
||||||
hits.forEach(hit => {
|
hits.forEach(hit => {
|
||||||
hit.url = hit.url.replace('ant.design', window.location.host);
|
hit.url = hit.url.replace('ant.design', window.location.host);
|
||||||
hit.url = hit.url.replace('https:', window.location.protocol)
|
hit.url = hit.url.replace('https:', window.location.protocol);
|
||||||
});
|
});
|
||||||
return hits;
|
return hits;
|
||||||
},
|
},
|
||||||
@ -131,6 +131,17 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
|||||||
return 'LTR';
|
return 'LTR';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getDropdownStyle = (): React.CSSProperties => {
|
||||||
|
const { direction } = this.context;
|
||||||
|
if (direction === 'rtl') {
|
||||||
|
return {
|
||||||
|
direction: 'ltr',
|
||||||
|
textAlign: 'right',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
onMenuVisibleChange = (visible: boolean) => {
|
onMenuVisibleChange = (visible: boolean) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
menuVisible: visible,
|
menuVisible: visible,
|
||||||
@ -233,6 +244,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
|||||||
size="small"
|
size="small"
|
||||||
defaultValue={antdVersion}
|
defaultValue={antdVersion}
|
||||||
onChange={this.handleVersionChange}
|
onChange={this.handleVersionChange}
|
||||||
|
dropdownStyle={this.getDropdownStyle()}
|
||||||
getPopupContainer={trigger => trigger.parentNode}
|
getPopupContainer={trigger => trigger.parentNode}
|
||||||
>
|
>
|
||||||
{versionOptions}
|
{versionOptions}
|
||||||
|
Loading…
Reference in New Issue
Block a user