-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor(cxl-tabs-slider): hide prev/next button on mobile #186
Comments
I would say "no", but there may be some opportunity to improve styling or something here. It's clear from screenshot
cc @anoblet |
Hiding the arrows until the element is focused is easy, centering the content is going to be harder. Since this is a modified version of ready() {
super.ready();
document.addEventListener('click', (event) => {
let themes = this.getAttribute('theme').split(' ');
if (this.contains(event.target)) {
themes = themes.filter((item) => item !== 'hide-scroll-buttons');
} else {
if (!themes.includes('hide-scroll-buttons')) {
themes.push('hide-scroll-buttons');
}
}
this.setAttribute('theme', themes.join(' '));
});
} |
Looking at this again, I don't believe it's a matter of centering, but rather the content is wider than the viewport. We can snap/center content using |
Draft PR: #187 Let me know if it's an improvement. You will need to use dev tools and emulate mobile as it only responds to the touchstart event. |
There should be a way to hide prev/next button on mobile.
The text was updated successfully, but these errors were encountered: