From ed39a25923ecc9abf1bf2e8b487969e6427a9d4e Mon Sep 17 00:00:00 2001 From: wanghaoo Date: Fri, 11 Jan 2019 10:11:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=BB=9A=E5=8A=A8=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=AD=E6=94=AF=E6=8C=81scroll=E5=80=BC?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=BF=AE=E6=94=B9):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Table.css | 5 +++++ build/Table.js | 2 +- build/TableHeader.js | 16 +++++++++------- package.json | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build/Table.css b/build/Table.css index c93b9cd..192a406 100644 --- a/build/Table.css +++ b/build/Table.css @@ -191,6 +191,11 @@ word-break: break-all; } .u-table tr th:last-child { overflow: hidden; } + .u-table tr.filterable th { + padding-top: 4px; + padding-bottom: 4px; } + .u-table tr.filterable th .filterContext { + height: 35px; } .u-table-row-hover { background: #e3f2fd; } .u-table-scroll { diff --git a/build/Table.js b/build/Table.js index cfe24f6..a84ffe7 100644 --- a/build/Table.js +++ b/build/Table.js @@ -1078,7 +1078,7 @@ var Table = function (_Component) { headerHeight = _props7.headerHeight, columns = _props7.columns; - var headRows = this.refs.headTable ? this.refs.headTable.querySelectorAll('thead tr') : this.refs.bodyTable.querySelectorAll('thead tr'); + var headRows = this.refs.headTable ? this.refs.headTable.querySelectorAll('thead') : this.refs.bodyTable.querySelectorAll('thead'); var bodyRows = this.refs.bodyTable.querySelectorAll('.' + clsPrefix + '-row') || []; var fixedColumnsHeadRowsHeight = [].map.call(headRows, function (row) { var height = headerHeight; diff --git a/build/TableHeader.js b/build/TableHeader.js index 5f57e08..5999c6a 100644 --- a/build/TableHeader.js +++ b/build/TableHeader.js @@ -614,7 +614,6 @@ var TableHeader = function (_Component) { var attr = dragborder ? { id: "u-table-drag-thead-" + this.theadKey } : {}; - return _react2["default"].createElement( "thead", _extends({ className: clsPrefix + "-thead" }, attr, { "data-theader-fixed": "scroll", ref: function ref(_thead) { @@ -637,11 +636,19 @@ var TableHeader = function (_Component) { if (lastShowIndex == columIndex) { canDotDrag = "th-can-not-drag"; } + var keyTemp = {}; + //避免key为undefined + if (da.dataindex && da.key === undefined) { + keyTemp.key = da.dataindex; + } if (filterable && index == rows.length - 1) { da.children = _this2.filterRenderType(da["filtertype"], da.dataindex, columIndex); + if (da.key === undefined) { + keyTemp.key = da.dataindex + '-filterable'; + } + delete da.filterdropdownfocus; } - var thDefaultObj = {}; var thClassName = "" + da.className ? "" + da.className : ''; if (draggable) { @@ -652,11 +659,6 @@ var TableHeader = function (_Component) { } thClassName += " " + fixedStyle; if (!da.fixed) { - var keyTemp = {}; - //避免key为undefined - if (da.dataindex) { - keyTemp.key = da.dataindex; - } return _react2["default"].createElement( "th", diff --git a/package.json b/package.json index d5d4838..0e8993c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "1.6.28", + "version": "1.6.29", "description": "Table ui component for react", "keywords": [ "react",