From 89c453e77138ef7d1f99e3e489614b7d6a334d9a Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Wed, 15 Nov 2017 09:26:09 +0100 Subject: [PATCH 1/4] Correcting #1500 : Dropdown not working correctly --- src/components/dropdown/action-menu.js | 5 ++++- src/components/dropdown/index.js | 23 ----------------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/components/dropdown/action-menu.js b/src/components/dropdown/action-menu.js index a7bafced2..319fd9ecc 100644 --- a/src/components/dropdown/action-menu.js +++ b/src/components/dropdown/action-menu.js @@ -1,8 +1,11 @@ import React, { Component } from 'react'; -import Button from '../../components/button'; import { translate } from 'focus-core/translation'; import noop from 'lodash/utility/noop' +import Button from '../../components/button'; +import MDBehaviour from '../../behaviours/material'; + +@MDBehaviour('dropdown') /** * Action menu component * diff --git a/src/components/dropdown/index.js b/src/components/dropdown/index.js index db864c80d..cd27f7876 100644 --- a/src/components/dropdown/index.js +++ b/src/components/dropdown/index.js @@ -1,8 +1,6 @@ import React, { Component, PropTypes } from 'react'; import ReactDOM from 'react-dom'; - import uuid from 'uuid'; -import 'material-design-lite/material'; import ActionMenu from './action-menu'; @@ -28,27 +26,6 @@ class Dropdown extends Component { this._htmlId = uuid.v4(); } - /** @inheritdoc */ - componentDidMount() { - if (0 !== this.props.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.upgradeElement(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - - /** @inheritdoc */ - componentWillReceiveProps(nextProps) { - if (0 !== nextProps.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.upgradeElement(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - - /** @inheritdoc */ - componentWillUnmount() { - if (0 !== this.props.operationList.length && ReactDOM.findDOMNode(this.refs.dropdown)) { - componentHandler.downgradeElements(ReactDOM.findDOMNode(this.refs.dropdown)); - } - } - /** @inheritdoc */ render() { const { iconProps, operationList, position, shape } = this.props; From 2538aa0b348dad346e7dfe4e685c28d0ed6c4341 Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Wed, 15 Nov 2017 09:29:27 +0100 Subject: [PATCH 2/4] Removing style import in focus index, to avoid variables problems --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dc825c416..837ddf3fa 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ //Generator http://patorjk.com/software/taag/#p=display&h=1&f=Banner4&t=Focus-COMPONENTS -import './style'; +// import './style'; import translation from 'focus-core/translation'; import history from 'focus-core/history'; From 14a9bf4d4215d184d8ec4d484b36dffe28518961 Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Wed, 15 Nov 2017 09:45:30 +0100 Subject: [PATCH 3/4] Correcting validation --- src/components/input/autocomplete-select-multiple/field.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/input/autocomplete-select-multiple/field.js b/src/components/input/autocomplete-select-multiple/field.js index e65902ae3..58fb4f263 100644 --- a/src/components/input/autocomplete-select-multiple/field.js +++ b/src/components/input/autocomplete-select-multiple/field.js @@ -68,7 +68,12 @@ class MultiAutocomplete extends Component { */ validate() { // do nothing, validation is done at each selection - return true; + const { isRequired } = this.props; + return ({ + isValid: !isRequired || (this.props.value && this.props.value.length > 0), + message: 'field.required' + }); + } /** From 834d91d9e1a1ea00f1ca53354ece83b0a25add92 Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Wed, 15 Nov 2017 09:50:08 +0100 Subject: [PATCH 4/4] Release 2.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00aa425a3..8d785b424 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "focus-components", - "version": "2.2.0", + "version": "2.2.1", "description": "Focus component repository.", "main": "index.js", "scripts": {