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

default block props is start #21

Closed
mteason opened this issue May 11, 2021 · 6 comments
Closed

default block props is start #21

mteason opened this issue May 11, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@mteason
Copy link

mteason commented May 11, 2021

if alignToTop is default, default of props block is also start.

@dominikbulaj
Copy link
Owner

Hi,
not sure what you mean, but yes, when alignToTop is set to true then those two options are used:

if (alignToTop) {
  options.block = 'start' // defines vertical alignment 
  options.inline = 'nearest' // defines horizontal alignment
}

Ref.: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView


If you think it's an issue, feel free to describe proper behavior :)

@mteason
Copy link
Author

mteason commented May 11, 2021

sorry for my bad english,
I just want to set block to 'center'

@dominikbulaj
Copy link
Owner

So you would like to set both block and inline to center, right? I think new prop can be used for that - something like alignCenter : boolean

@dominikbulaj dominikbulaj added the enhancement New feature or request label May 11, 2021
@mteason
Copy link
Author

mteason commented May 11, 2021

yes, I hope scrollIntoViewOptions could be customized

@dominikbulaj
Copy link
Owner

Right, good point. scrollIntoViewOptions can be an optional object prop that when passed it overwrites other settings. I will work on it today or tomorrow.
Stay tuned and thanks, @mteason :)

@dominikbulaj
Copy link
Owner

Released as v1.9.0
You can pass scrollIOptions that accepts an object with the same properties as you can pass to element.scrollIntoView(scrollIntoViewOptions);. See MDN docs

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

No branches or pull requests

2 participants