mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 16:53:50 +08:00
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:
@ -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
|
<Form.Item
|
||||||
name="newPassword"
|
name="newPassword"
|
||||||
hidden={this.state.current !== 2}
|
hidden={this.state.current !== 2}
|
||||||
@ -415,7 +415,7 @@ class ForgetPage extends React.Component {
|
|||||||
}}
|
}}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
passwordPopoverOpen: true,
|
passwordPopoverOpen: application.organizationObj.passwordOptions?.length > 0,
|
||||||
passwordPopover: PasswordChecker.renderPasswordPopover(application.organizationObj.passwordOptions, this.form.current?.getFieldValue("newPassword") ?? ""),
|
passwordPopover: PasswordChecker.renderPasswordPopover(application.organizationObj.passwordOptions, this.form.current?.getFieldValue("newPassword") ?? ""),
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
@ -607,7 +607,7 @@ class SignupPage extends React.Component {
|
|||||||
}
|
}
|
||||||
} else if (signupItem.name === "Password") {
|
} else if (signupItem.name === "Password") {
|
||||||
return (
|
return (
|
||||||
<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
|
<Form.Item
|
||||||
name="password"
|
name="password"
|
||||||
className="signup-password"
|
className="signup-password"
|
||||||
@ -635,7 +635,7 @@ class SignupPage extends React.Component {
|
|||||||
}}
|
}}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
passwordPopoverOpen: true,
|
passwordPopoverOpen: application.organizationObj.passwordOptions?.length > 0,
|
||||||
passwordPopover: PasswordChecker.renderPasswordPopover(application.organizationObj.passwordOptions, this.form.current?.getFieldValue("password") ?? ""),
|
passwordPopover: PasswordChecker.renderPasswordPopover(application.organizationObj.passwordOptions, this.form.current?.getFieldValue("password") ?? ""),
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
@ -132,18 +132,18 @@ export const PasswordModal = (props) => {
|
|||||||
</Row>
|
</Row>
|
||||||
) : null}
|
) : null}
|
||||||
<Row style={{width: "100%", marginBottom: "20px"}}>
|
<Row style={{width: "100%", marginBottom: "20px"}}>
|
||||||
<Popover placement="right" content={passwordPopover} open={passwordPopoverOpen}>
|
<Popover placement={window.innerWidth >= 960 ? "right" : "top"} content={passwordPopover} open={passwordPopoverOpen}>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
addonBefore={i18next.t("user:New Password")}
|
addonBefore={i18next.t("user:New Password")}
|
||||||
placeholder={i18next.t("user:input password")}
|
placeholder={i18next.t("user:input password")}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
handleNewPassword(e.target.value);
|
handleNewPassword(e.target.value);
|
||||||
setPasswordPopoverOpen(true);
|
setPasswordPopoverOpen(passwordOptions?.length > 0);
|
||||||
setPasswordPopover(PasswordChecker.renderPasswordPopover(passwordOptions, e.target.value));
|
setPasswordPopover(PasswordChecker.renderPasswordPopover(passwordOptions, e.target.value));
|
||||||
|
|
||||||
}}
|
}}
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
setPasswordPopoverOpen(true);
|
setPasswordPopoverOpen(passwordOptions?.length > 0);
|
||||||
setPasswordPopover(PasswordChecker.renderPasswordPopover(passwordOptions, newPassword));
|
setPasswordPopover(PasswordChecker.renderPasswordPopover(passwordOptions, newPassword));
|
||||||
}}
|
}}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
|
Reference in New Issue
Block a user