Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(Popup): filter out NaN values from Popper's styles #1365

Merged
merged 4 commits into from
May 21, 2019

Conversation

kuzhelov
Copy link
Contributor

@kuzhelov kuzhelov commented May 21, 2019

Problem

The problem is Popper's calculation logic outputs NaN values for the cases where height (or width) of reference element is 0. However, this is pretty common case for test environments, where styles may not be rendered/applied to Popup's trigger - and, as a result, it will have height of 0.

This, in its turn, results in invalid styles being applied to rendered div element, as calculated by Popper styles are just passed to slot's div component, with NaN values being there:

image

Resolution strategy

This PR provides fix that will guarantee that simple mount of Popup component in client's tests won't result in console errors - by removing style props that has NaN as value.

@kuzhelov kuzhelov changed the title introduce fix fix(Popup): filter out NaN values from Popper's styles May 21, 2019
@codecov
Copy link

codecov bot commented May 21, 2019

Codecov Report

Merging #1365 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1365      +/-   ##
==========================================
+ Coverage   72.35%   72.35%   +<.01%     
==========================================
  Files         772      772              
  Lines        5751     5752       +1     
  Branches     1703     1680      -23     
==========================================
+ Hits         4161     4162       +1     
  Misses       1584     1584              
  Partials        6        6
Impacted Files Coverage Δ
packages/react/src/components/Popup/Popup.tsx 68.48% <100%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b2bd0b...dad9946. Read the comment docs.

@kuzhelov kuzhelov merged commit 4bea866 into master May 21, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/remove-nan-values-from-popup-position-styles branch May 21, 2019 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants