Popper-core: Hello World - popper text overwrites reference until resize

Created on 13 Apr 2016  路  6Comments  路  Source: popperjs/popper-core

I feel foolish like I'm missing something essential.

Codepen test case

generic_popper_overwrites_text

<span class="myReference">Hello</span>
var reference = document.querySelector('.myReference');
new Popper(reference, {content: 'World'}, {placement: 'right'})
# BUG 馃悶

Most helpful comment

Seems like a problem with the first update, if you then scroll or resize the window, it works properly.

All 6 comments

Is there a recommended baseline css to use with this for placement? I threw in the popper.css from the popper.js.org site and it's closer.

It looks like minimally, if you don't have the following, you'll see this behavior:

.popper {
  position: absolute;
}

Perhaps this is just something to throw in the readme if I'm not wrong?

Seems like a problem with the first update, if you then scroll or resize the window, it works properly.

Still no solution about this issue ?

I need a free weekend to work on it, still had no time :/

A PR is welcome tho

Fixed the problem.

The position of the popper element wasn't set before the computations performed by the first .update(). Now I set the position before everything else, so we are sure the update works properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cixonline picture cixonline  路  5Comments

Johann-S picture Johann-S  路  3Comments

diondiondion picture diondiondion  路  4Comments

Madhu94 picture Madhu94  路  3Comments

memboc picture memboc  路  3Comments