aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/EditableView.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-14 00:38:23 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-14 00:38:23 -0500
commit1edc0a77874bc701a1821b630f167a29688faa07 (patch)
tree2ef8381b0a50e0c037048190d97fa50a1e96b911 /src/client/views/EditableView.tsx
parente5a23f3d3966db9b57a1919f8d9bfff9fdfedf1e (diff)
parent9300029e95dcb8406cd05ed57c9d86107df49547 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into anika_schema_view
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r--src/client/views/EditableView.tsx23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx
index e0e205df9..e21d431b1 100644
--- a/src/client/views/EditableView.tsx
+++ b/src/client/views/EditableView.tsx
@@ -66,16 +66,17 @@ export class EditableView extends React.Component<EditableProps> {
EditableView.loadId = "";
}
- @action
- componentDidUpdate(nextProps: EditableProps) {
- // this is done because when autosuggest is turned on, the suggestions are passed in as a prop,
- // so when the suggestions are passed in, and no editing prop is passed in, it used to set it
- // to false. this will no longer do so -syip
- if (nextProps.editing && nextProps.editing !== this._editing) {
- this._editing = nextProps.editing;
- EditableView.loadId = "";
- }
- }
+ // @action
+ // componentDidUpdate(nextProps: EditableProps) {
+ // // this is done because when autosuggest is turned on, the suggestions are passed in as a prop,
+ // // so when the suggestions are passed in, and no editing prop is passed in, it used to set it
+ // // to false. this will no longer do so -syip
+ // console.log("props editing = " + nextProps.editing);
+ // if (nextProps.editing && nextProps.editing !== this._editing) {
+ // this._editing = nextProps.editing;
+ // EditableView.loadId = "";
+ // }
+ // }
_didShow = false;
@@ -109,7 +110,7 @@ export class EditableView extends React.Component<EditableProps> {
if (this._ref.current && this.props.showMenuOnLoad) {
this.props.menuCallback?.(this._ref.current.getBoundingClientRect().x, this._ref.current.getBoundingClientRect().y);
} else {
- if (!this.props.onClick || !this.props.onClick(e)) {
+ if (!this.props.onClick?.(e)) {
this._editing = true;
this.props.isEditingCallback?.(true);
}