@beisen-platform/dropdown-list
Advanced tools
Comparing version 1.0.25 to 1.0.26
@@ -138,3 +138,4 @@ import "core-js/modules/es6.function.name"; | ||
_this.setState({ | ||
selectDate: selectDate | ||
selectDate: selectDate, | ||
sortData: selectDate | ||
}); | ||
@@ -147,3 +148,3 @@ | ||
if (_this.state.keepActive) { | ||
_this.renderDOM(event.target.parentNode.parentNode, selectDate); | ||
_this.renderDOM(event.target.parentNode.parentNode, selectDate, selectDate); | ||
} | ||
@@ -178,3 +179,3 @@ }; | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (JSON.stringify(nextProps.children) != JSON.stringify(this.props.children)) { | ||
if (JSON.stringify(nextProps.children) != JSON.stringify(this.props.children) || nextProps.value != this.props.value) { | ||
this.setState({ | ||
@@ -210,6 +211,6 @@ children: nextProps.children, | ||
key: "renderDOM", | ||
value: function renderDOM(tar, selectDate) { | ||
value: function renderDOM(tar, selectDate, sortData) { | ||
if (!this.props.showPanel || !tar) return; | ||
var children = this.state.children; | ||
if (this.props.sortDataActive) selectDate = this.state.sortData; | ||
if (this.props.sortDataActive) selectDate = sortData ? sortData : this.state.sortData; | ||
children.map(function (item, index) { | ||
@@ -216,0 +217,0 @@ item.isChecked = false; |
{ | ||
"name": "@beisen-platform/dropdown-list", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "表单下拉选择器,多选或单选,可直接用于表单中", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -47,3 +47,3 @@ import React, { Component } from 'react'; | ||
componentWillReceiveProps(nextProps) { | ||
if (JSON.stringify(nextProps.children) != JSON.stringify(this.props.children)) { | ||
if (JSON.stringify(nextProps.children) != JSON.stringify(this.props.children) || nextProps.value != this.props.value) { | ||
this.setState({ | ||
@@ -72,6 +72,6 @@ children: nextProps.children, | ||
renderDOM(tar, selectDate) { | ||
renderDOM(tar, selectDate, sortData) { | ||
if (!this.props.showPanel || !tar) return; | ||
let children = this.state.children; | ||
if(this.props.sortDataActive) selectDate = this.state.sortData; | ||
if(this.props.sortDataActive)selectDate = sortData ? sortData : this.state.sortData; | ||
children.map((item, index) => { | ||
@@ -197,3 +197,3 @@ item.isChecked = false; | ||
selectDate = selectDate.filter((it) => item.value != it.value); | ||
this.setState({ selectDate: selectDate }); | ||
this.setState({ selectDate: selectDate, sortData: selectDate}); | ||
window.activeTarget = null; | ||
@@ -203,3 +203,3 @@ this.props.onClick && this.props.onClick(event, item, selectDate, selectDate); | ||
if (this.state.keepActive) { | ||
this.renderDOM(event.target.parentNode.parentNode, selectDate); | ||
this.renderDOM(event.target.parentNode.parentNode, selectDate, selectDate); | ||
} | ||
@@ -206,0 +206,0 @@ }; |
719208
6114