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

Controls order and HTML structure #2

Open
michaelwarren1106 opened this issue Jul 26, 2022 · 10 comments
Open

Controls order and HTML structure #2

michaelwarren1106 opened this issue Jul 26, 2022 · 10 comments

Comments

@michaelwarren1106
Copy link

michaelwarren1106 commented Jul 26, 2022

Love the alpha release!

I was taking a look at the docs page and poking around to see if I can use this component to create my datepicker that i'll need pretty soon, and I found something I'd like to ask about.

Currently the controls at the top are hardcoded into left and right with the month & year select being left, and the next/prev month being right.

image

As currently coded if I wanted to make a picker like:
image

I wouldnt really be able to, even with the css parts, because each of the controls elements isnt its own container inside the flexbox container of top-controls. I could reverse the order visually to put the arrows on the left and the month/year select on the right, but I cant put the selects in the middle of the arrows.

Would you be open to a PR that changes that internal style so that all the children of top-controls are separate (removing the stylistic concept of right and left controls)? Additionally, could we potentially order the controls like my desired screenshot above by default (prev arrow, month select, year select, next arrow)? I think that would definitely help the configurability of this component because I think that a lot of folks will end up styling the calendar like my screenshot above, so having the default arrangement of those elements would save lots of styling on the consumer's side.

Thoughts?

@claviska
Copy link
Contributor

This is a good point, and +1 for using a flex container to group all "top controls." Aside from reversing, this would also allow users to specify arbitrary positions via order.

@michaelwarren1106
Copy link
Author

Ya, i was checking the code out again, and I think each of the controls, when separated probably becomes a css part/css vars also, so that you can individually style all the controls however you want?

@break-stuff
Copy link
Owner

I think this is a great idea! I like the flexibility this would provide.

@break-stuff
Copy link
Owner

It looks like there may be some accessibility issues with rearranging the order with flex.

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Ordering_Flex_Items#the_order_property_and_accessibility

@claviska
Copy link
Contributor

claviska commented Aug 3, 2022

From https://developer.mozilla.org/en-US/docs/Web/CSS/order

If the visual (css) order is important, then screen reader users will not have access to the correct reading order.

Does the visual order matter for these options? For example, if you’re tabbing through the control and can reach every one of them, does it matter which one is first or last?

@break-stuff
Copy link
Owner

It may be a bit disorienting, but might not be the end of the world.

@michaelwarren1106
Copy link
Author

i doubt the order truly matters. and also, my reason for splitting these controls up is to change the default order of the controls to: prev month, month select, year select, next month.

i’m fairly confident that with that as the default order of the controls, there will be very little reason to change the order with flex ordering. imo that default order makes a ton of sense.

@break-stuff
Copy link
Owner

I was planning on refactoring the controls to be similar to the design above. This original design was based on Chome's date picker implementation.

@michaelwarren1106
Copy link
Author

hey hey, bumping this (and the other) thread! Would you be open to accepting PRs for these features/redesigns?

@break-stuff
Copy link
Owner

Yes, please! Sorry for the delay. Life has been crazy busy.

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

No branches or pull requests

3 participants