mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
fix: Prevent scroll when focusing
This commit is contained in:
parent
0ad9cffb08
commit
26f464eb25
10 changed files with 31 additions and 14 deletions
|
@ -43,7 +43,9 @@ const BoardMembershipsStep = React.memo(
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
searchField.current.focus();
|
||||
searchField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
@ -63,7 +63,9 @@ const AddStep = React.memo(({ onCreate, onClose }) => {
|
|||
}, [openStep]);
|
||||
|
||||
useEffect(() => {
|
||||
nameField.current.focus();
|
||||
nameField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
useDidUpdate(() => {
|
||||
|
|
|
@ -89,7 +89,9 @@ const LabelsStep = React.memo(
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
searchField.current.focus();
|
||||
searchField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (step) {
|
||||
|
|
|
@ -61,7 +61,9 @@ const AddStep = React.memo(
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
searchField.current.focus();
|
||||
searchField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (step) {
|
||||
|
|
|
@ -88,7 +88,9 @@ const UserAddStep = React.memo(
|
|||
}, [onCreate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
emailField.current.focus();
|
||||
emailField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -90,7 +90,9 @@ const UserEmailEditStep = React.memo(
|
|||
}, [email, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
emailField.current.focus();
|
||||
emailField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -71,7 +71,9 @@ const UserPasswordEditStep = React.memo(
|
|||
}, [usePasswordConfirmation, onUpdate, data]);
|
||||
|
||||
useEffect(() => {
|
||||
passwordField.current.focus();
|
||||
passwordField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -90,7 +90,9 @@ const UserUsernameEditStep = React.memo(
|
|||
}, [username, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||
|
||||
useEffect(() => {
|
||||
usernameField.current.focus();
|
||||
usernameField.current.focus({
|
||||
preventScroll: true,
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -3,9 +3,10 @@ import { Input as SemanticUIInput } from 'semantic-ui-react';
|
|||
import InputPassword from './InputPassword';
|
||||
import InputMask from './InputMask';
|
||||
|
||||
const Input = SemanticUIInput;
|
||||
export default class Input extends SemanticUIInput {
|
||||
static Password = InputPassword;
|
||||
|
||||
Input.Password = InputPassword;
|
||||
Input.Mask = InputMask;
|
||||
static Mask = InputMask;
|
||||
|
||||
export default Input;
|
||||
focus = (options) => this.inputRef.current.focus(options);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import InputMask from 'react-input-mask';
|
||||
|
||||
export default class MaskedInput extends InputMask {
|
||||
focus() {
|
||||
this.getInputDOMNode().focus();
|
||||
focus(options) {
|
||||
this.getInputDOMNode().focus(options);
|
||||
}
|
||||
|
||||
select() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue