Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix last column resize bug when no data #2775

Merged
merged 1 commit into from Jan 15, 2018
Merged

fix last column resize bug when no data #2775

merged 1 commit into from Jan 15, 2018

Conversation

hxsf
Copy link
Contributor

@hxsf hxsf commented Jan 9, 2018

If a table has heigth and last column is auto width

let width = ''
// is_last_column, true && top_always_true && height_set_by_user, true
if ( this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) {
    // width will be 0 + this.$parent.scrollBarWidth === this.$parent.scrollBarWidth
    // so last column will be 10~20px(the width of scrollBar)
}

there is an example with iview@2.8.0

If a table has heigth and last column is auto width

let width = ''
// is_last_column, true && top_always_true && height_set_by_user, true
if ( this.columns.length === index + 1 && top && this.$parent.bodyHeight !== 0) {
// width will be 0 + this.$parent.scrollBarWidth === this.$parent.scrollBarWidth
// so last column will be 10~20px(the width of scrollBar)
}
there is an example with iview@2.8.0
[gist](https://gist.github.com/anonymous/e04e86c9e99d4d1e97bf327769acd345)
[demo on jsbin](http://jsbin.com/soqogagiqu)
@icarusion
Copy link
Contributor

Can you elaborate on this bug? I didn't see any problems with my Chrome.

@hxsf
Copy link
Contributor Author

hxsf commented Jan 9, 2018

  1. follow this link: demo on jsbin
  2. click the button
  3. the table last column's width will be 17px

iview_bug

@icarusion
Copy link
Contributor

it work good here
qq20180110-153722-hd

@cys85
Copy link

cys85 commented Jan 11, 2018

iview@2.8.0 我也发现了这个问题,无数据、有height,columns 最后一个不定宽的情况下 会出现这个问题

@hxsf
Copy link
Contributor Author

hxsf commented Jan 12, 2018

My env: chrome v63.0.3239.132, windows and macOS also has this problem.

@icarusion
Copy link
Contributor

@hxsf Mac Chrome 63, 你的在线示例在我这里运行一切正常。

@hxsf
Copy link
Contributor Author

hxsf commented Jan 12, 2018

image
image

@icarusion

  • 左边是 canary 版
  • 右侧是 stable 版
  • macOS 10.12
  • 出问题的时候 body 不会显示 “暂无数据”
  • firefox dev 最后一列消失。

@hxsf
Copy link
Contributor Author

hxsf commented Jan 12, 2018

@icarusion Maybe we can use browserling to test this.

@hxsf
Copy link
Contributor Author

hxsf commented Jan 12, 2018

@icarusion 我好像知道为什么你的正常的了,再次看你的图片,我发现你的滚动条会自动隐藏,所以 width(是'') + '' 还是 '' 所以你的浏览器中显示是正常的。

你是否安装了某些 chrome 插件来隐藏滚动条?

@icarusion
Copy link
Contributor

will check

@icarusion icarusion merged commit 24e156e into iview:2.0 Jan 15, 2018
@icarusion
Copy link
Contributor

Thanks for your pr!

@hxsf hxsf deleted the patch-1 branch January 16, 2018 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants