Uikit: Bug in uikit-core function

Created on 8 Aug 2018  路  1Comment  路  Source: uikit/uikit

UIkit version


3.0.0-rc.10

Browser

Google Chrome Version 67.0.3396.99

Reproduction Link


Steps to reproduce

Hovering over a dropdown in the navbar made the dropdown disappear instantly and threw an error:

Uncaught ReferenceError: r2 is not defined
    at pointInRect (uikit.js?d840:243)
    at UIkitComponent.handler (uikit.js?d840:4442)
    at eval (uikit.js?d840:12)
    at HTMLDivElement.eval (uikit.js?d840:3404)
pointInRect @ uikit.js?d840:243
handler @ uikit.js?d840:4442
(anonymous) @ uikit.js?d840:12
(anonymous) @ uikit.js?d840:3404

Dropdown has an issue in uikit-core.js specifically this function:

function pointInRect(point, rect) {
        return point.x <= r2.right &&
            point.x >= r2.left &&
            point.y <= r2.bottom &&
            point.y >= r2.top;
    }

What is Expected?

Needs the parameter renamed inside all the functions named pointInRect like this:

function pointInRect(point, rect) {
        return point.x <= rect.right &&
            point.x >= rect.left &&
            point.y <= rect.bottom &&
            point.y >= rect.top;
    }

And this now behaves as intended with no console errors and the dropdown no longer disappears instantly.

What is actually happening?

This was actually happening on version 3.0.0-rc9 as well as 3.0.0-rc10 now.

Most helpful comment

Thanks, resolved with 5ad623fd9f9d79fa3e42995860fd5832fd552b83

>All comments

Thanks, resolved with 5ad623fd9f9d79fa3e42995860fd5832fd552b83

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doublex picture doublex  路  3Comments

evdama picture evdama  路  3Comments

eric-22 picture eric-22  路  3Comments

kirlat picture kirlat  路  3Comments

danishiqbal4 picture danishiqbal4  路  3Comments