scroll issue fixed
This commit is contained in:
parent
7e0ccd16e8
commit
c93cdb1e43
@ -64,6 +64,15 @@ const Main = inject("rootStore") ( observer(
|
|||||||
this.sheet.detach()
|
this.sheet.detach()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
if(this.state.visible) {
|
||||||
|
//Scroll to top
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
handleItemClick(e, { name }) {
|
handleItemClick(e, { name }) {
|
||||||
this.props.handleItemClick(name);
|
this.props.handleItemClick(name);
|
||||||
|
|
||||||
|
@ -82,6 +82,11 @@ const Edit = inject("rootStore") ( observer(
|
|||||||
var login;
|
var login;
|
||||||
var password;
|
var password;
|
||||||
if(nextProps.open) {
|
if(nextProps.open) {
|
||||||
|
if(window.innerWidth <= 700) {
|
||||||
|
//Scroll to top
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
url = nextProps.data[nextProps.editIndex].url;
|
url = nextProps.data[nextProps.editIndex].url;
|
||||||
login = decrypt(nextProps.data[nextProps.editIndex].login, nextProps.encryptionkey);
|
login = decrypt(nextProps.data[nextProps.editIndex].login, nextProps.encryptionkey);
|
||||||
password = decrypt(nextProps.data[nextProps.editIndex].password, nextProps.encryptionkey);
|
password = decrypt(nextProps.data[nextProps.editIndex].password, nextProps.encryptionkey);
|
||||||
|
@ -78,6 +78,11 @@ const New = inject("rootStore") ( observer(
|
|||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if(nextProps.open !== this.props.open) {
|
if(nextProps.open !== this.props.open) {
|
||||||
|
if(nextProps.open && window.innerWidth <= 700) {
|
||||||
|
//Scroll to top
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
//Empty input fields
|
//Empty input fields
|
||||||
this.setState({
|
this.setState({
|
||||||
url: '',
|
url: '',
|
||||||
|
@ -2,6 +2,7 @@ import React, {Component} from 'react';
|
|||||||
import jss from 'jss';
|
import jss from 'jss';
|
||||||
import preset from 'jss-preset-default';
|
import preset from 'jss-preset-default';
|
||||||
import { Container } from 'semantic-ui-react';
|
import { Container } from 'semantic-ui-react';
|
||||||
|
import history from '../../stores/functions/history';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions import
|
* Functions import
|
||||||
@ -48,6 +49,11 @@ class Home extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
history.push('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.sheet.detach()
|
this.sheet.detach()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user