diff --git a/components/select/style/rtl.less b/components/select/style/rtl.less index 8400c73253..1c7269cfd2 100644 --- a/components/select/style/rtl.less +++ b/components/select/style/rtl.less @@ -28,8 +28,7 @@ // ========================== Popup ========================== &-dropdown { &-rtl { - direction: ltr; - text-align: right; + direction: rtl; } } diff --git a/site/theme/template/Layout/Header/index.tsx b/site/theme/template/Layout/Header/index.tsx index 70b9d605e1..4ccdc0ca72 100644 --- a/site/theme/template/Layout/Header/index.tsx +++ b/site/theme/template/Layout/Header/index.tsx @@ -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 { 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 { size="small" defaultValue={antdVersion} onChange={this.handleVersionChange} + dropdownStyle={this.getDropdownStyle()} getPopupContainer={trigger => trigger.parentNode} > {versionOptions}