Open motss opened 4 years ago
hi @motss, great work, I haven't use it since version 1:
Another change you will need to apply to app-datepicker
is to prevent page scrolling on keyup events (only on calendar view): for example, go to your Configurable demo powered by Firebase and increase the screen font size until vertical scroll appears (Crtl ++), then focus a date on the calendar (not in dialog) and just press Arrow Up and Arrow Down moving between months => the page will scroll vertically.
This is because your handler is passive, so you cannot prevent it's propagation (I also tested to focus the target cell with preventScroll: false
without success), so I suggest you to change it to not using passive event handler, use keydown instead keyup and prevent it's propagation.
If the dialog is shown on a popop instead on a dialog, it is very fustrating using the keyboard, the page will scroll up and down => just see the new Web Core Vitals concepts from Google (you can see that on chrome devtools on perfomance tab it will appear a new entry called Experience (between Frames and Main), you will see there:
Warning: Cumulative Layout Shifts can result in poor user experiences.
I also forget you need to add to all buttons the attribute type="button"
, this will prevent fire submit if shown inside a form (year, current date and month buttons).
I also forget you need to add to all buttons the attribute
type="button"
, this will prevent fire submit if shown inside a form (year, current date and month buttons).
Please raise an issue ticket for this.
hi @motss, great work, I haven't use it since version 1:
Another change you will need to apply to
app-datepicker
is to prevent page scrolling on keyup events (only on calendar view): for example, go to your Configurable demo powered by Firebase and increase the screen font size until vertical scroll appears (Crtl ++), then focus a date on the calendar (not in dialog) and just press Arrow Up and Arrow Down moving between months => the page will scroll vertically.This is because your handler is passive, so you cannot prevent it's propagation (I also tested to focus the target cell with
preventScroll: false
without success), so I suggest you to change it to not using passive event handler, use keydown instead keyup and prevent it's propagation.If the dialog is shown on a popop instead on a dialog, it is very fustrating using the keyboard, the page will scroll up and down => just see the new Web Core Vitals concepts from Google (you can see that on chrome devtools on perfomance tab it will appear a new entry called Experience (between Frames and Main), you will see there:
Warning: Cumulative Layout Shifts can result in poor user experiences.
Please raise an issue ticket for this.
There's a number of helper functions that appear to have been dropped, e.g. hasClass
and findShadowTarget
.
Are there alternative methods for what these used to do?
There's a number of helper functions that appear to have been dropped, e.g.
hasClass
andfindShadowTarget
.
In v6, most of the helpers are not needed due to low usage if not no usage at all after some rewrite.
Are there alternative methods for what these used to do?
I'm assuming you're using some of the helpers in the module. IMHO this is quite risky as they are not meant for public. I'd recommend to either create your own helper functions instead of depending on those 'private' helpers in this module or just copy those to be your own helpers.
I'd recommend to either create your own helper functions instead of depending on those 'private' helpers in this module or just copy those to be your own helpers
Thanks for your reply, @motss
Yes, I'd already started copying the functions into our own repo. I just wanted to check there wasn't some new methods that I was missing.
How is it possible for v5 to be deprecated if v6 is still an RC? All tools (eg npm-check-updates, npmjs.com) still show v5 as the latest version.
@KTibow Thatβs a valid question. You may be curious about the reason. It was because v6 had to wait for the stable release of the MD web and Lit 3. Now that MD3 and Lit 3 are out with major changes, the plan is to add them to the stable v6.
What to expect
AppDatePicker
- π Redesigned date picker element with Material Design 2AppDatePickerDialog
- π Redesigned date picker dialog element with Material Design 2AppDatePickerInput
- π New date picker input element with Material Design 2Highlights
Caveats
input[type=date]
has had great support in all mobile OSes for years and they leverage its own native date picker UI.Planned
AppRangeDatePicker
- πNew range date picker first introduced in the Material Design 2. Again this will only support desktops.AppRangeDatePickerDialog
- πNew range date picker dialog with Material Design 2AppRangeDatePickerInput
- πNew range date picker input with Material Design 2Roadmap
app-datepicker
RC becomes the default branch onMarch 27, 2022
! π πapp-datepicker@6.0.0
- First major release to includeAppDatePicker
,AppDatePickerDialog
and the newAppDatePickerInput
app-datepicker@6.1.0
- (TBD) Another minor release to includeAppRangeDatePicker
,AppRangeDatePickerInput
, andAppRangeDatePickerInput
.@material/web
- v1 has been released alongside a new website designed and built with Material Design 3. Lit 3 also only available in components from@material/web
. Major refactoring work needs to be done for a stable v6 release with Lit 3 and MD3 upgrades (#221). Stay tuned...References