-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2020 expression editor allow for double click to add value #2021
#2020 expression editor allow for double click to add value #2021
Conversation
@@ -184,6 +176,8 @@ | |||
} | |||
|
|||
.properties-vt-row-selected { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthoward366 Added style here to retain the style until the user click somewhere else. :focus
& :active
, is not retaining the style after clicking, and shows at the clicking moment only.
Please let me know what looks best.
Overall looks good. Checking with design on some of the interactions. |
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
9334dd5
to
dd7ebdc
Compare
@matthoward366 Does it mean we can highlight the row(with the blue border) on single-click as well? |
single-click would highlight the row when clicking the |
Signed-off-by: Veena S <Veena.S1@ibm.com>
border: 1px solid $button-primary; | ||
background-color: $background-active; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthoward366 I tried to add :focus
and :active
here. .properties-vt-row-doubleClick
class is being detected, but the style of :focus and :active not working.
@@ -56,6 +56,9 @@ export default class ExpressionSelectFieldOrFunction extends React.Component { | |||
this.fields = this._makeDatasetFields(props.controller.getDatasetMetadataFields(), props.controller.getExpressionInfo().fields); | |||
this.resources = get(props.controller.getExpressionInfo(), "resources", {}); | |||
this.state = { | |||
doubleClickedFieldRow: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to manage double click different from single click?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthoward366 properties-vt-row-doubleClick
class was added for styling the double clicked row(a blue border) which is not required for single click.
For activating this class, I have used doubleClickedFieldRow
from props.
Couldn't rely on the doubleclick event alone, as single-clicking the +
icon was supposed to act/look the same way as double-click
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would step back and really only handle the onRowDoubleClick
and change the pointer. Possibly add focus for the row. I don't think we need to worry about the active
state.
@@ -439,6 +444,7 @@ class VirtualizedTable extends React.Component { | |||
className={classNames(className, | |||
{ "properties-vt-row-selected": selectedRow }, | |||
{ "properties-vt-row-disabled": rowDisabled }, | |||
{ "properties-vt-row-doubleClick": this.getDoubleClickedRow()?.indexOf(rowData.rowKey) > -1 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties-vt-row-doubleClick
class was added for styling the double clicked row(a blue border) which is not required for single click.
@@ -138,7 +138,16 @@ | |||
// ReadonlyTable with single row selection is non-interactive. Nothing should happen on hover | |||
background-color: $layer-hover-01; | |||
} | |||
|
|||
.properties-vt-row-doubleClick{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have row focus when a user tabs into the row but I don't think we need something special for double click. Also, active and focus are different things.
border-left: 4px solid $button-primary; | ||
padding-left: 0; | ||
&:not(.properties-vt-row-disabled):hover { | ||
border-left: 4px solid $button-primary; | ||
} | ||
} | ||
.properties-vt-row-doubleClick{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like duplicate code.
ok Matt, I would revert the code added for styling the double clicked row. |
@veenas1 let me know when the changes are done and I'll have another look. |
Signed-off-by: Veena S <Veena.S1@ibm.com>
…into virtualized-table-double-click
@matthoward366 I have reverted all the changes added as part of styling double clicked row, the state props etc, also removed active style. The :focus is coming only on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing the wrong mouse pointer in places outside the expression builder. For example in the field picker the entire selected row has a pointer but it shouldn't since it's not clickable.
@@ -138,7 +138,10 @@ | |||
// ReadonlyTable with single row selection is non-interactive. Nothing should happen on hover | |||
background-color: $layer-hover-01; | |||
} | |||
|
|||
&:focus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? This might need to go under expression builder only and not the default for all tables.
@@ -189,6 +192,7 @@ | |||
&:hover { | |||
background-color: $layer-accent-hover-01; | |||
} | |||
cursor: pointer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this show up? This might be specific to expression builder.
@@ -200,8 +204,13 @@ | |||
// Table rows | |||
.properties-vt-row-class { | |||
padding-left: 3px; | |||
&:focus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above.
} | ||
.properties-vt-row-selected { | ||
cursor: pointer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Quality Gate passedIssues Measures |
0757310
to
b53bc7b
Compare
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
Signed-off-by: Veena S <Veena.S1@ibm.com>
@matthoward366 Updated the PR to apply changes only for expression builder's table. |
Fixes: #2020
Developer's Certificate of Origin 1.1