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

enhancement(Timepicker) styling updates #572

Open
wants to merge 8 commits into
base: v2-dev
Choose a base branch
from

Conversation

gselderslaghs
Copy link
Member

Proposed changes

Updated timepicker styling towards Material M3 standards #558

Removed all modal related wrappers and selectors
Implemented m3 theme vars
Refactored positioning, replaced relative and absolute properties with flex
Implemented additional accessibility

Screenshots (if appropriate) or codepen:

Screenshot 2024-12-30 at 01 11 58 Screenshot 2024-12-30 at 01 12 11 Screenshot 2024-12-30 at 01 12 48

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My commit messages follows the conventional commit format
  • My change requires a change to the documentation, and updated it accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@gselderslaghs gselderslaghs changed the base branch from main to v2-dev December 30, 2024 00:22
@gselderslaghs
Copy link
Member Author

gselderslaghs commented Dec 30, 2024

Additionally implemented autosubmit that can be used for the docked timepicker and reverted exclusion of confirm button interaction for handling with modal

Since the deprecation of open close methods in #525 the following method can be used for interaction with timepicker and modal

html

<div class="row">
    <div class="input-field datepicker-field s12">
        <input id="timepicker" type="text" class="timepicker">
        <label for="timepicker">Time</label>
    </div>
</div>

<dialog class="modal" style="width: 620px"></dialog>

script

M.Timepicker.init(document.querySelectorAll('.timepicker'), {
    autoSubmit: false,
    container: '.modal',
    onInputInteraction: () => {
        toggleModal();
    },
});

const modal = document.querySelector('.modal');
const toggleModal = () => {
    if (!modal.hasAttribute('open')) {
        modal.setAttribute('open', 'true');
    } else {
        modal.removeAttribute('open');
    }
}

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.

1 participant