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

Don't open TimePickerModal on click time-picker-preview #1

Open
BalGuldur opened this issue Feb 28, 2017 · 4 comments
Open

Don't open TimePickerModal on click time-picker-preview #1

BalGuldur opened this issue Feb 28, 2017 · 4 comments

Comments

@BalGuldur
Copy link

Don't open modal becourse click on time-picker run two function: toggleFocus() and onClearFocus() becourse element OutsideClickHandler catch this click as outside click. toggleFocus() - open modal then onClearFocus() close modal.
I think need add overElement data for TimePicker(), add
@mouseover="overElement=true" @mouseout="overElement=false" to time-picker-preview,
and change onClearFocus() to:

  !this.overElement && (this.focused = false)
  !this.overElement && this.onFocusChanged && this.onFocusChanged(false)
@DomonJi DomonJi added the bug label Mar 1, 2017
@DomonJi
Copy link
Owner

DomonJi commented Mar 1, 2017

I know what you mean, but actually I just want to toggle the modal when clicking on the preview panel. I think it's reasonable.
Anyway, thanks a lot for your advice.

@DomonJi
Copy link
Owner

DomonJi commented Mar 1, 2017

Maybe I could make this behavior configurable. 😃

@BalGuldur
Copy link
Author

Mmm. Maybe i don't understand. But u live demo (https://domonji.github.io/vue-clock-picker/) work prefect as need, and click on preview panel -> toggle modal with clock. But version on master branch and npm package don't toggle modal with clock by click on preview panel.
Becourse click on preview panel runing two handler: toggleFocus() on preview panel and onOutsideClickHandler() on OutsideClickHandler. (area of preview panel is outside for OutsideClickHandler and OutsideClickHandler is focused (changed by toggleFocus()) )
Anyway, thx for this project, it's good. Thx if u fix this, or add configurable props.
Second way for fix this, is expand OutsideClickHandler to preview panel + modal.

P.S. if need, i can create version with autoswitch from hour to minutes on choose hour, and close modal on choose minutes, and add pull request.

@DomonJi DomonJi added the bug label Mar 2, 2017
@DomonJi
Copy link
Owner

DomonJi commented Mar 2, 2017

That's strange. I remember I built this live demo with master branch.
However, I'll test it and find out what is going wrong.

It would be very nice if you add pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants