Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
d56df3c9
Commit
d56df3c9
authored
7 years ago
by
Atte Keinänen
Browse files
Options
Downloads
Patches
Plain Diff
Force repaint to make Safari render buttons correctly
parent
5e462b99
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/metabase/lib/dom.js
+7
-0
7 additions, 0 deletions
frontend/src/metabase/lib/dom.js
frontend/src/metabase/query_builder/components/filters/OperatorSelector.jsx
+15
-4
15 additions, 4 deletions
...ase/query_builder/components/filters/OperatorSelector.jsx
with
22 additions
and
4 deletions
frontend/src/metabase/lib/dom.js
+
7
−
0
View file @
d56df3c9
...
...
@@ -208,3 +208,10 @@ export function constrainToScreen(element, direction, padding) {
}
return
false
;
}
// Used for tackling Safari rendering issues
export
function
forceRedraw
(
domNode
)
{
domNode
.
style
.
display
=
'
none
'
;
domNode
.
offsetHeight
;
domNode
.
style
.
display
=
''
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/src/metabase/query_builder/components/filters/OperatorSelector.jsx
+
15
−
4
View file @
d56df3c9
/* @flow */
import
React
,
{
Component
}
from
"
react
"
;
import
ReactDOM
from
"
react-dom
"
;
import
PropTypes
from
"
prop-types
"
;
import
Icon
from
"
metabase/components/Icon.jsx
"
;
import
cx
from
"
classnames
"
;
import
_
from
"
underscore
"
;
import
{
forceRedraw
}
from
"
metabase/lib/dom
"
;
import
Icon
from
"
metabase/components/Icon.jsx
"
;
import
type
{
Operator
,
OperatorName
}
from
"
metabase/meta/types/Metadata
"
type
Props
=
{
...
...
@@ -39,6 +41,15 @@ export default class OperatorSelector extends Component<*, Props, State> {
onOperatorChange
:
PropTypes
.
func
.
isRequired
};
expandOperators
=
()
=>
{
this
.
setState
({
expanded
:
true
});
// HACK: Address Safari rendering bug which causes https://github.com/metabase/metabase/issues/5075
setTimeout
(()
=>
{
forceRedraw
(
ReactDOM
.
findDOMNode
(
this
));
},
0
);
};
render
()
{
let
{
operator
,
operators
}
=
this
.
props
;
let
{
expanded
}
=
this
.
state
;
...
...
@@ -65,7 +76,7 @@ export default class OperatorSelector extends Component<*, Props, State> {
</
button
>
)
}
{
!
expanded
&&
expandedOperators
.
length
>
0
?
<
div
className
=
"text-grey-3 cursor-pointer"
onClick
=
{
()
=>
this
.
setState
({
expanded
:
true
})
}
>
<
div
className
=
"text-grey-3 cursor-pointer"
onClick
=
{
this
.
expandOperators
}
>
<
Icon
className
=
"px1"
name
=
"chevrondown"
size
=
{
14
}
/>
More Options
</
div
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment