feat: show the popover on the top when window's width too small and close popover when password options is empty (#3952)

This commit is contained in:
DacongDA
2025-07-10 19:56:05 +08:00
committed by GitHub
parent cb5c7667b5
commit ef14c84edc
3 changed files with 7 additions and 7 deletions

View File

@ -385,7 +385,7 @@ class ForgetPage extends React.Component {
},
]}
/>
<Popover placement="right" content={this.state.passwordPopover} open={this.state.passwordPopoverOpen}>
<Popover placement={window.innerWidth >= 960 ? "right" : "top"} content={this.state.passwordPopover} open={this.state.passwordPopoverOpen}>
<Form.Item
name="newPassword"
hidden={this.state.current !== 2}
@ -415,7 +415,7 @@ class ForgetPage extends React.Component {
}}
onFocus={() => {
this.setState({
passwordPopoverOpen: true,
passwordPopoverOpen: application.organizationObj.passwordOptions?.length > 0,
passwordPopover: PasswordChecker.renderPasswordPopover(application.organizationObj.passwordOptions, this.form.current?.getFieldValue("newPassword") ?? ""),
});
}}