-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
[Explore][Adhoc Filters] Expanding the Adhoc Filter popover when the content expands #5032
[Explore][Adhoc Filters] Expanding the Adhoc Filter popover when the content expands #5032
Conversation
ee84ffc
to
209ad80
Compare
Codecov Report
@@ Coverage Diff @@
## master #5032 +/- ##
=======================================
Coverage 77.35% 77.35%
=======================================
Files 44 44
Lines 8677 8677
=======================================
Hits 6712 6712
Misses 1965 1965 Continue to review full report at Codecov.
|
@@ -78,6 +79,13 @@ export default class AdhocFilterEditPopover extends React.Component { | |||
document.removeEventListener('mousemove', this.onMouseMove); | |||
} | |||
|
|||
adjustHeight(heightDifference) { | |||
this.setState(state => ({ | |||
...state, |
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.
Do you need this? I thought you could just return the update to state.
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.
yeah I think this can be omitted.
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.
good call fixing now
adjustHeight(heightDifference) { | ||
this.setState(state => ({ | ||
...state, | ||
height: state.height + heightDifference, |
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.
Just curious, is there a specific reason to add the height difference instead of just strictly setting the new height?
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.
FWIW the re-resizable
library I'm using for the new dashboard passes a delta.
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.
The big issue is that there are two things that can resize the popover ->
-
the user dragging the box
-
the input component expanding
tracking deltas just simplified dealing with both of those
@GabeLoins a few questions but lgtm otherwise! |
@@ -163,6 +188,12 @@ export default class AdhocFilterEditPopoverSimpleTabContent extends React.Compon | |||
} | |||
} | |||
|
|||
multiComparatorRef(ref) { | |||
if (ref) { |
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.
are there cases where you don't get a ref
? that seems strange but mostly curious.
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 don't understand why but I've seen refs come in as undefined
sometimes
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.
thanks for fixing this!
lgtm after @michellethomas 's question about ...state
209ad80
to
2823332
Compare
2823332
to
d68c718
Compare
(cherry picked from commit a746fce)
Previously to this PR, when adding/viewing a simple filter with number of comparators this could happen:
That doesn't look so great and also makes it quite annoying to make any changes because you are forced to manually expand the box to hit save. In this PR I have the popover expand in reaction when the input field expands.
test plan:
reviewers:
@michellethomas @john-bodley @williaster @mistercrunch