Skip to content

Commit

Permalink
Fix exclusive rendering canceling
Browse files Browse the repository at this point in the history
On editorInteraction exclusive rendering should be canceled unconditionally.

Fixes #163
  • Loading branch information
ipeychev committed Apr 9, 2015
1 parent 1422ce7 commit c25efb5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 56 deletions.
52 changes: 0 additions & 52 deletions src/ui/react/src/components/base/widget-click-outside.js

This file was deleted.

15 changes: 11 additions & 4 deletions src/ui/react/src/components/base/widget-exclusive.js
Expand Up @@ -24,12 +24,19 @@
},

/**
* Lifecycle. Invoked once before the component is mounted.
* Lifecycle. Invoked when a component is receiving new props.
* This method is not called for the initial render.
* Calling this.setState() within this function will not trigger an additional render.
*
* @param {Object} nextProps Object containing the current set of properties.
*/
getInitialState: function() {
return {
componentWillReceiveProps: function(nextProps) {
// Receiving properties means that the component is being re-rendered.
// Re-rendering is triggered by editorInteraction, so we have to
// reset the exclusive state and render the UI according to the new selection.
this.setState({
itemExclusive: null
};
});
},

/**
Expand Down
10 changes: 10 additions & 0 deletions src/ui/react/src/components/main.jsx
Expand Up @@ -9,6 +9,15 @@
var UI = React.createClass({
mixins: [global.WidgetExclusive, global.WidgetFocusManager],

/**
* Lifecycle. Invoked once before the component is mounted.
*/
getInitialState: function() {
return {
hidden: false
};
},

/**
* Lifecycle. Returns the default values of the properties used in the widget.
*
Expand Down Expand Up @@ -117,6 +126,7 @@
editor.focus();

this.setState({
itemExclusive: null,
selectionData: editor.getSelectionData(),
trigger: event.data
});
Expand Down

0 comments on commit c25efb5

Please sign in to comment.