mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +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(() => {
|
useEffect(() => {
|
||||||
searchField.current.focus();
|
searchField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -63,7 +63,9 @@ const AddStep = React.memo(({ onCreate, onClose }) => {
|
||||||
}, [openStep]);
|
}, [openStep]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
nameField.current.focus();
|
nameField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useDidUpdate(() => {
|
useDidUpdate(() => {
|
||||||
|
|
|
@ -89,7 +89,9 @@ const LabelsStep = React.memo(
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
searchField.current.focus();
|
searchField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (step) {
|
if (step) {
|
||||||
|
|
|
@ -61,7 +61,9 @@ const AddStep = React.memo(
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
searchField.current.focus();
|
searchField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (step) {
|
if (step) {
|
||||||
|
|
|
@ -88,7 +88,9 @@ const UserAddStep = React.memo(
|
||||||
}, [onCreate, data]);
|
}, [onCreate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailField.current.focus();
|
emailField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -90,7 +90,9 @@ const UserEmailEditStep = React.memo(
|
||||||
}, [email, usePasswordConfirmation, onUpdate, onClose, data]);
|
}, [email, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailField.current.focus();
|
emailField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -71,7 +71,9 @@ const UserPasswordEditStep = React.memo(
|
||||||
}, [usePasswordConfirmation, onUpdate, data]);
|
}, [usePasswordConfirmation, onUpdate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
passwordField.current.focus();
|
passwordField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -90,7 +90,9 @@ const UserUsernameEditStep = React.memo(
|
||||||
}, [username, usePasswordConfirmation, onUpdate, onClose, data]);
|
}, [username, usePasswordConfirmation, onUpdate, onClose, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
usernameField.current.focus();
|
usernameField.current.focus({
|
||||||
|
preventScroll: true,
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -3,9 +3,10 @@ import { Input as SemanticUIInput } from 'semantic-ui-react';
|
||||||
import InputPassword from './InputPassword';
|
import InputPassword from './InputPassword';
|
||||||
import InputMask from './InputMask';
|
import InputMask from './InputMask';
|
||||||
|
|
||||||
const Input = SemanticUIInput;
|
export default class Input extends SemanticUIInput {
|
||||||
|
static Password = InputPassword;
|
||||||
|
|
||||||
Input.Password = InputPassword;
|
static Mask = InputMask;
|
||||||
Input.Mask = InputMask;
|
|
||||||
|
|
||||||
export default Input;
|
focus = (options) => this.inputRef.current.focus(options);
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import InputMask from 'react-input-mask';
|
import InputMask from 'react-input-mask';
|
||||||
|
|
||||||
export default class MaskedInput extends InputMask {
|
export default class MaskedInput extends InputMask {
|
||||||
focus() {
|
focus(options) {
|
||||||
this.getInputDOMNode().focus();
|
this.getInputDOMNode().focus(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
select() {
|
select() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue