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 ==========================
|
||||
&-dropdown {
|
||||
&-rtl {
|
||||
direction: ltr;
|
||||
text-align: right;
|
||||
direction: rtl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ function initDocSearch(locale: string) {
|
||||
transformData(hits: { url: string }[]) {
|
||||
hits.forEach(hit => {
|
||||
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;
|
||||
},
|
||||
@ -131,6 +131,17 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
||||
return 'LTR';
|
||||
};
|
||||
|
||||
getDropdownStyle = (): React.CSSProperties => {
|
||||
const { direction } = this.context;
|
||||
if (direction === 'rtl') {
|
||||
return {
|
||||
direction: 'ltr',
|
||||
textAlign: 'right',
|
||||
};
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
onMenuVisibleChange = (visible: boolean) => {
|
||||
this.setState({
|
||||
menuVisible: visible,
|
||||
@ -233,6 +244,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
|
||||
size="small"
|
||||
defaultValue={antdVersion}
|
||||
onChange={this.handleVersionChange}
|
||||
dropdownStyle={this.getDropdownStyle()}
|
||||
getPopupContainer={trigger => trigger.parentNode}
|
||||
>
|
||||
{versionOptions}
|
||||
|
Loading…
Reference in New Issue
Block a user