Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add specific padding to boundaries (#518) #615

Merged
merged 1 commit into from Apr 26, 2018

Conversation

BrianBu01
Copy link

There were no tests for this class already, but all existing tests still pass.

boundaries.left += padding.left || padding;
boundaries.top += padding.top || padding;
boundaries.right -= padding.right || padding;
boundaries.bottom -= padding.bottom || padding;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably fallback to 0 in case one of the sides is not defined (eg: {top: 10, left: 20 }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok got it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated now with the last squash+push

@FezVrasta
Copy link
Member

May you add few tests to cover the new cases please?

@BrianBu01
Copy link
Author

@FezVrasta After I get these tests done, how long would it be until this is in a version? I have a week until code freeze, so need to either fork this and go off that, or need to have these changes in.

@FezVrasta
Copy link
Member

As soon this is merged I'll release the new version with this feature in.

@BrianBu01
Copy link
Author

OK I am working on a few other higher priority issues, I'll get some tests in as soon as I can.

@BrianBu01
Copy link
Author

BrianBu01 commented Apr 18, 2018

@FezVrasta I created some tests around the method, also tweaked your changes to support nulls.

Ahh IE tests are failing and I am on a Mac. Can you help with that please?

@FezVrasta
Copy link
Member

You can get an Internet Explorer VM for free from here:
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

I don't have time to look into it by myself unfortunately.

@BrianBu01 BrianBu01 force-pushed the #518 branch 11 times, most recently from ccc12df to efc5183 Compare April 19, 2018 22:58
@BrianBu01
Copy link
Author

@FezVrasta Tests are added and passing. Some Tests are not passing for IE10 and IE11, but those tests were a backfill for missing tests for existing functionality.

@BrianBu01
Copy link
Author

@FezVrasta This is ready for your review.

@FezVrasta
Copy link
Member

I don't get why the tests are not passing on IE...this isn't any browser specific functionality

@BrianBu01
Copy link
Author

BrianBu01 commented Apr 24, 2018

@FezVrasta I'm not sure either, but those tests were just backfill only related due to proximity. Can we still get these changes in now, and one of us can take a closer look when we have more time? I have to pull this into my current project today, and I'll have to go off my clone if it isn't in yours.

@FezVrasta
Copy link
Member

I'd rather wait until we have a solid pr sorry

@BrianBu01
Copy link
Author

@FezVrasta Since those test don't have to with the change, would just removing them, make the pr "solid" for you?

@FezVrasta
Copy link
Member

No sorry. If they work on master they must work here as well.

I'll be able to better look at this PR this evening anyway

@BrianBu01
Copy link
Author

I tried debugging the tests on another PR, as I am not sure how to get the IE tests to run locally even under a VM.

Pretty much I think IE is doing something funny in getBoundingClientRect.

computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] +
computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]
: 0
? (parseInt(html[`offset${axis}`]) +
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are strings in IE10 such as 0px, so you are doing string concatenation here instead of addition. You end up with 1070px0px0px. Then maxing with that param causes NAN to be returned.

@BrianBu01
Copy link
Author

@FezVrasta Well there you go.

@FezVrasta FezVrasta merged commit 981f562 into floating-ui:master Apr 26, 2018
@lixiaoyan
Copy link

@FezVrasta Could you please publish a new version for this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants