Comments (10)
@KhanhTranJBI I played around with this a bit, and this can be resolved by disabling a setting in popper.js that ember-tooltips enables by default, called escapeWithReference
(more info here in the README.md)
e.g.
<EmberTooltip @popperOptions={{popperOptions}}>
...
</EmberTooltip>
where popperOptions
is defined on the component as something like:
{
preventOverflow: {
escapeWithReference: false
}
}
from ember-tooltips.
@KhanhTranJBI it looks like you may be using custom CSS to style the tooltips. Could you share that along with the context of how you're using the tooltip (e.g. a snippet of the handlebars template)?
from ember-tooltips.
@maxfierke yes, I am using a custom CSS. If I do not override CSS for tooltip then the tooltip width is around 50px which is too small and part of the tooltip is out of browser window screen.
Here is a component
<EmberTooltip
@onShow={{action "setContent"}}
@updateFor={{this.content}}
@side={{side}}
>
{{#if this.content}}
{{this.content}}
{{else}}
<div class="loading-spinner"></div>
{{/if}}
</EmberTooltip>```
Here is a custom CSS
```.ember-tooltip {
min-width: 200px;
max-width: 316px;
background-color: white;
color: black;
border: 1px solid green;
text-shadow: none;
.tooltip-inner {
border: none;
background-color: white;
color: black;
}
.loading-spinner {
@include loading-spinner();
min-height: 10;
min-width: 50;
}
}```
from ember-tooltips.
Here is if I do not override tooltip width CSS
from ember-tooltips.
@KhanhTranJBI is there any absolute or relative positioning on any of the parent elements?
from ember-tooltips.
@maxfierke yes, its parent elements has relative position as well as absolute position
Relative position on parent element
Absolute position on other parent element
from ember-tooltips.
Ahh, that may be what's causing issues with popper.js
's auto-placement. You may have luck passing @popperContainer="body"
with your <EmberTooltip>
, as that will position the tooltip relative to the <body>
element.
from ember-tooltips.
@maxfierke It looks better, but the tooltip is still out of the browser window. Please check!
from ember-tooltips.
@maxfierke It is the same. My coworker suggested me to use @side="bottom-end"
which is good enough to solve the issue I have. Thank you so much @maxfierke!
from ember-tooltips.
@KhanhTranJBI I played around with this a bit, and this can be resolved by disabling a setting in popper.js that ember-tooltips enables by default, called
escapeWithReference
(more info here in the README.md)e.g.
<EmberTooltip @popperOptions={{popperOptions}}> ... </EmberTooltip>
where
popperOptions
is defined on the component as something like:{ preventOverflow: { escapeWithReference: false } }
This solved the problem for me.
Thanks!
from ember-tooltips.
Related Issues (20)
- Having popover style the same as tooltip HOT 2
- Disable all ember-tooltips styles HOT 1
- Positioning the pointer/arrow so it's not always centered in 3.x HOT 10
- Update documentation and tests to use Octane features
- Remove tooltip from DOM on hide HOT 3
- Issue with tooltip positioning HOT 4
- Upgrade to popper@2? HOT 8
- Deprecation warnings with Ember 3.20 HOT 5
- Wrong Sentence at line 335 of README file
- IE 11 - Not working due to js errors HOT 6
- Hiding popover on target click or inside click HOT 1
- onHide triggers even if tooltip wasn't shown HOT 1
- Deprecation warning: Using `run.bind` has been deprecated HOT 2
- Must use import to load ES Module eslint-scope/lib/definition.js HOT 2
- Increased memory usage on 3.5.1
- Remove use of ember global Ember.testing
- Security Vulnerability: glob-parent@<5.1.2
- Popover showing behind elements below HOT 1
- Add Glint TypeScript types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-tooltips.