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

Inline time dropdown is open by default #223

Open
trymeouteh opened this issue Mar 10, 2024 · 0 comments
Open

Inline time dropdown is open by default #223

trymeouteh opened this issue Mar 10, 2024 · 0 comments

Comments

@trymeouteh
Copy link

trymeouteh commented Mar 10, 2024

When using a inline time picker, the time dropdown open is open by default. I think this behavior is not intended and the dropdown should not be visible by default.

I do have a fix for this but it is kinda "hacky" which can work as a temporary solution.

<link rel="stylesheet" href="node_modules/@bevacqua/rome/dist/rome.min.css">



<div id="myTime"></div>



<script src="node_modules/@bevacqua/rome/dist/rome.min.js"></script>

<script>
    const myTime = rome(document.querySelector('#myTime'), {
        date: false
    }).on('ready', function () {
        //Inline time pickers by default are open (dropdowned). This one line command below will select the first option and close the dropdown
        myTime.associated.getElementsByClassName('rd-time-option')[0].click();
    });
</script>
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

1 participant