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

[Bug Report] When table components use totals, there is a fixed in the column, and the style is confused #5415

Closed
pengzhen-developer opened this issue Jun 16, 2017 · 10 comments

Comments

@pengzhen-developer
Copy link

Element UI version

1.3.6

OS/Browsers version

window / chrome 59.0.3071.86

Vue version

2.3.4

Reproduction Link

https://jsfiddle.net/mwk2d3yh/

Steps to reproduce

table 组件使用 show-summary 的情况下, 如果存在 fixed 的列, 合计样式乱掉了.

What is Expected?

合计在滚动条下方, 拖动滚动条正确滚动合计栏

What is actually happening?

合计在滚动条上方, 滚动条被遮挡

@element-bot element-bot changed the title [Bug Report] 表格组件使用合计时, 列存在 fixed, 样式混乱 When [Bug Report] table components use totals, there is a fixed in the column, and the style is confused Jun 16, 2017
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

1.3.6

OS/Browsers version

Window / Chrome 59.0.3071.86

Vue version

2.3.4

Reproduction Link

https://jsfiddle.net/mwk2d3yh/

Steps to reproduce

When table components use show-summary, if there is a column of fixed, the total pattern is out of order

What is Expected?

Below the scroll bar, drag the scroll bar to scroll properly to the total column

What is actually happening?

Above the scroll bar, the scroll bar is blocked

@tianwang8090
Copy link

我也遇到同样的问题!!

@magic-code
Copy link

到目前还存在这样的问题,好像挺久没修复啊 用的版本1.4.1

@furybean
Copy link
Contributor

furybean commented Jan 17, 2018

Reproduce in 2.x: https://jsfiddle.net/mwk2d3yh/4/

@shiqian123
Copy link

` .el-table--scrollable-x .el-table__body-wrapper{
// ::-webkit-scrollbar {display:none}
overflow: hidden
}
.el-table__footer-wrapper{
overflow-x: auto

}`

I reset the style. Now the new problem is that when the mouse is on the last line, it can roll.

@kangxiaoxiao
Copy link

我也碰到了同样的问题

@rideron89
Copy link

For anyone wrestling with this issue, I was able to work around it with the following code:

<template>
    <el-table ref="invoicesTable">...</el-table>
</template>

<script>
// I use the lodash.debounce library, but any debounce function should work
import debounce from "lodash.debounce"

export default {
    data () {
        return {
            // set here so we don't need to keep setting it for each scroll
            $tableFooter: null
        }
    },

    created () {
        // create a bound function so it can easily by added/removed as an event listener
        this.boundScrollSummaryContent = this.scrollSummaryContent.bind(this)

        // HIGHLY RECOMMEND you debounce this function since it gets called every Vue.update() call
        this.debouncedInitializeSummaryScroller = debounce(this.initializeSummaryScroll.bind(this), 400)
    },

    updated () {
        // when the DOM is updated, add the scrolling event listener
        this.debouncedInitializeSummaryScroller()
    },

    methods: {
        // sets the scroll position of the summary row to that of the table body
        scrollSummaryContent (ev) {
            if (this.$tableFooter) {
                this.$tableFooter.scrollLeft = ev.target.scrollLeft
            }
        },

        initializeSummaryScroll () {
            const $table = this.$refs.invoicesTable
            const $body = $table.$el.querySelector(".el-table__body-wrapper.is-scrolling-left")

            this.$tableFooter = $table.$el.querySelector(".el-table__footer-wrapper")

            if ($body && this.$tableFooter) {
                // make sure we remove the original event listener so it doesn't fire more than once
                $body.removeEventListener("scroll", this.boundScrollSummaryContent)
                $body.addEventListener("scroll", this.boundScrollSummaryContent)
            }
        }
    }
}
</script>

@stale
Copy link

stale bot commented Dec 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 19, 2019
@stale stale bot closed this as completed Dec 26, 2019
@danyunLu
Copy link

danyunLu commented Feb 25, 2020

Maybe you can try this,it worked in my project

.el-table--scrollable-x .el-table__fixed {
bottom: 8px; // table-scroll-bar-height
height: auto !important;
}

@senolatac
Copy link

I have same problem with version 2.13.2

@lingwenzhi lingwenzhi mentioned this issue Nov 6, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants