-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix sporadic dates (#3664) #3665
Conversation
This prevents spurious updates while typing, but still sends when enter is pressed, focus is lost, or the GUI is clicked (due to the remaining `changeDate` and `change` handlers).
Conflicts: NEWS.md inst/www/shared/shiny.js inst/www/shared/shiny.js.map inst/www/shared/shiny.min.js inst/www/shared/shiny.min.js.map
And I'm also not sure why @cpsievert any idea how to fix this? |
Aha, the yarn issue may be due to yarnpkg/berry#2399 / yarnpkg/berry#2774 (comment), since I'm building on a Mac and the github checks are on Ubuntu. ...but, I get the same checksum when building on a Rocky 8 box, so maybe that's not it. Unless MacOS and Rocky8 match while Ubuntu is different, but that'd be strange. |
Downgrading my node/npm to match the versions listed here does not change my checksum for this package. |
Hah, looks like that got the test to pass...might be worth looking into what exactly's wrong with the checksum, but I suspect it's a yarn bug rather than a shiny bug. |
Remaining test failure is due to #4133 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dvg-p4 for the fix and for patiently keeping this PR up to date. We agree that the current behavior of sending eager updates is problematic and that your solution of not reporting updates on keydown is a good choice.
I have a few minor edits to comments and the news entry. I've also manually verified that we do have your CLA on file; I wasn't able to figure out what is happening with the cla-assistant but we don't need the check.
Thanks again!
Closes #3664.
This pull request removes the handlers for
keyup
andinput
fromdateInput
anddateRangeInput
. This prevents spurious updates while typing, but still sends the parser's best interpretation of the field when enter is pressed, focus is lost (i.e. the user clicks out), or a date selection is made in the GUI (due to the remainingchangeDate
andchange
handlers).A value of
null
(fordateInput
) orNA
(fordateRangeInput
) is still sent immediately when the field is cleared, but this can be more easily checked for and ignored on the server side. I suspect thatbootstrap-datepicker
is interpreting the empty string as a special value and firing off thechangeDate
event, and stopping that would probably be much more intensive than removing a few lines of code.Not sure if y'all will want to shove this into 1.7.2, leave it for the next release, or if there's some crazy use case I can't imagine where you'd want "2001-01-0" to be immediately interpreted as the last day of 1999.Edit: Merged in 1.7.2-1.7.4 changes, no conflicts except for minified JS as usual.
Edit 2: Merged in all changes up to the current development version 1.9.1.9000, again no conflicts except for minified JS.