question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangePicker clicks on a different area to close the date box for a bug that triggers the onChange event of the old value

See original GitHub issue

RangePicker 点击其他区域关闭日期框会触发返回一个旧值的OnChange事件的BUG,如下图所示:

RangePicker Clicking on another area to close the date box triggers a BUG that returns an old Value OnChange event, as shown in the following figure:

image

只有按下拉框里的确定按钮关闭才不会触发旧的Onchange事件

Only pressing the OK button in the drop-down box to close does not trigger the old Onchange event

所以点击其他区域关闭日期框是不是不应该触发一个Onchange?

So clicking on other areas to close the date box shouldn’t trigger an Onchange?

code: <RangePicker OnChange="OnDatePickChange" AllowClear="@false" Value="@(new DateTime?[] {)" TValue="DateTime?[]" ShowTime='@("HH:mm")' Format="MM-dd HH:mm"/>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Alexbitscommented, Sep 17, 2022

But now there is no way for me to get the latest value, because the value returned by the onchange event is messy, how do I get the latest value instead of letting it be restored?

Maybe it’s possible to come up with an API to set it up?

@Alexbits

@GlodenBoy Please read the above and wait a bit while the OnChange behavior will be fixed.

1reaction
Alexbitscommented, Sep 16, 2022

@Alexbits

I think clicking on a date triggers an Onchange event is right, I just don’t understand that clicking on an empty area to close the drop-down date box after I’ve selected 2 dates will trigger an Onchange event with the wrong value, which shouldn’t need to be triggered because the values have already been changed.

@GlodenBoy The OnChange should not be triggered by the closed dropdown. This will be fixed.

Should the behavior of clicking on an empty area to close the drop-down box be consistent with the behavior of the OK button?

No, it should not have the same behavior as the OK button. It reverts the value to the previous one or clears it if not confirmed with the OK button.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateTimePicker and TimePicker should accept the value ...
DateTimePicker & TimePicker do not have 'final click' to let component know what time is the value user want to submit.
Read more >
How can I detect the onChange event for the start and end ...
Everytime the onChange or onCalendarChange event is triggered on the RangePicker, I get both dates, and I want to detect the events separately, ......
Read more >
DatePicker
RangePicker ; allowEmpty, Allow start or end input leave empty, [boolean, boolean] ; dateRender, Custom rendering function for date cells, >= 5.4.0 use...
Read more >
Date Range Picker for Bootstrap
The Date Range Picker is attached to a text input. It will use the current value of the input to initialize, and update...
Read more >
Date Range Picker — JavaScript Date & Time Picker Library
Produces: You can customize Date Range Picker with options, and get notified when the user chooses new dates by providing a callback function....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found