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

Multiple DateTimeRangeContainers #65

Open
shanestreator opened this issue Sep 23, 2021 · 0 comments
Open

Multiple DateTimeRangeContainers #65

shanestreator opened this issue Sep 23, 2021 · 0 comments

Comments

@shanestreator
Copy link

shanestreator commented Sep 23, 2021

It'd be nice to be able to define a id property on DateTimeRangeContainer.
All associated actions/values would be bound to the defined id.

<DateTimeRangeContainer id="daterangepicker-1" />
<DateTimeRangeContainer id="daterangepicker-2" />
<DateTimeRangeContainer id="daterangepicker-3" />

Is this a potentially quick feature to implement?

Attempted workaround scenario:

// Successfully mutating the id onMount
useEffect(() => {
        document.querySelector(`.${props.name} .daterangepicker`).setAttribute('id', `${props.name}`)
}, [props])

render (
    <div className={`input-group ${props.name}`}> 
        // QTY 2 ========== (id and class for calendar by default is "daterangepicker")
        <DateTimeRangeContainer> <Form.Control /> </DateTimeRangeContainer> 
        <DateTimeRangeContainer> <Form.Control /> </DateTimeRangeContainer> 
    </div>
)

The [2nd DateTimeRangeContainer] with a unique id updates the [1st DateTimeRangeContainer].

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