这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@MatthewKennedy
Copy link

@MatthewKennedy MatthewKennedy commented Mar 11, 2019

Use fixed positioning to avoid the clipping that is seen when the picker modal is generated inside an element with position relative & overflow set to scroll or hidden.

Use fixed positioning to avoid the clipping that is seen when the picker modal is generated inside an element with overflow scroll or hidden.
@MatthewKennedy
Copy link
Author

Absolute
Screenshot 2019-03-11 at 14 55 32

@MatthewKennedy
Copy link
Author

Fixed Positioning
Screenshot 2019-03-11 at 14 54 31

Copy link
Contributor

@DanielRuf DanielRuf left a comment

Choose a reason for hiding this comment

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

This is a breaking change imo and I think this should be an optin solution or just documented.

@MatthewKennedy
Copy link
Author

Hi @DanielRuf what is broken on this change?

Fixed position uses the view port as its frame of reference, absolute uses the nearest parent element with position set to relative.

In theory for use as a modal fixed positioning would offer a more sturdy base point.

@amsul
Copy link
Owner

amsul commented Mar 11, 2019

@MatthewKennedy this is a breaking change because previous versions of this library use position: absolute. It has better usability on mobile (especially older devices).

If your parent element prevents filling the entire window, you might find the container option more suitable for your needs: https://amsul.ca/pickadate.js/date/#container

@amsul
Copy link
Owner

amsul commented Mar 11, 2019

Not only that, but anyone can add the CSS in this PR to their own stylesheets if that's what they prefer :)

@MatthewKennedy
Copy link
Author

Both good suggestions, I'll play around with the container setting from the js.

@amsul
Copy link
Owner

amsul commented Apr 3, 2019

@MatthewKennedy I'm gonna assume this is safe to close :)

@amsul amsul closed this Apr 3, 2019
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.

3 participants