Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit f711bd0

Browse files
author
soliury
committed
use setTimeout to measure view
1 parent 5ebd4dd commit f711bd0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/containers/Comments.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class Comments extends Component {
4747
this.state = {
4848
ds: ds.cloneWithRows(data),
4949
commentLoading: false,
50-
textInput: null,
5150
replyUploading: false,
5251
isLoaded: false,
5352
didFocus: false
@@ -72,7 +71,6 @@ class Comments extends Component {
7271

7372

7473
componentDidMount() {
75-
this.flag = 0
7674
this._fetchComment()
7775
KeyboardEventEmitter.on(KeyboardEvents.KeyboardDidShowEvent, this.updateKeyboardSpace)
7876
KeyboardEventEmitter.on(KeyboardEvents.KeyboardWillHideEvent, this.resetKeyboardSpace)
@@ -93,13 +91,13 @@ class Comments extends Component {
9391

9492

9593
componentDidUpdate() {
96-
//this._scrollToReply()
94+
setTimeout(() => this._scrollToReply())
9795
}
9896

9997

10098
_scrollToReply() {
10199
let reply = this.props.reply
102-
if (reply && this.flag == 1) {
100+
if (reply) {
103101
let row = this[reply.id]
104102
if (row && row.measure) {
105103
row.measure((x, y, width, height, pageX, pageY) => {

0 commit comments

Comments
 (0)