Skip to content

Commit

Permalink
Merge pull request #742 from XiaoMi/hotfix/1.5.12
Browse files Browse the repository at this point in the history
fix: checkbox list do not change but rerender
  • Loading branch information
zhan8863 authored Oct 28, 2019
2 parents 5dca19f + 742643c commit 9f4adf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions components/checkbox/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Base from './Base'
import MultipleCheckboxsOpera from './common'
import isEqual from 'lodash/isEqual'
class CheckBox extends Component {
static _type = 'CheckBox'
static propTypes = {
Expand Down Expand Up @@ -32,6 +33,12 @@ class CheckBox extends Component {
componentWillUnmount () {
MultipleCheckboxsOpera.remove(this.props.name || this.props.all)
}
shouldComponentUpdate (nextProps, nextState) {
if (this.props.list && isEqual(this.props.list, nextProps.list)) {
return false
}
return true
}
renderCheckBoxGroup (list) {
return <div>
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hi-ui/hiui",
"version": "1.5.11",
"version": "1.5.12",
"description": "HIUI for React",
"scripts": {
"test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",
Expand Down

0 comments on commit 9f4adf1

Please sign in to comment.