slickgrid-universal icon indicating copy to clipboard operation
slickgrid-universal copied to clipboard

Datepicker with manual input

Open zewa666 opened this issue 1 year ago • 2 comments

Clear and concise description of the problem

The new vanilla calender is working great, in combo with copy & paste you're also able to quickly fill out values. Sometimes though, its simply easier to change the date by actually typing it in. Currently slickgrid doesn't provide this feature as the input box is always readonly.

Suggested solution

When a date cell editor is opened, there should be an option to configure readonly mode. If disabled, users can enter dates in the input field and they get synced back to the date control.

image

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Wikis.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

zewa666 avatar Sep 18 '24 08:09 zewa666

Ah yeah that's probably a decent addition to go with, in Flatpickr we had the allowInput, I was using that in my previous unit tests

Allows the user to enter a date directly into the input field. By default, direct entry is disabled.

https://github.com/ghiscoding/slickgrid-universal/blob/11b565e0e2623d20669b838263fb1638f53ea5dc/packages/common/src/editors/tests/dateEditor.spec.ts#L222-L226

I think it might be ok to add this as a new option into the VanillaCalendarOption interface, however I think it should stay as disabled or unset by default

https://github.com/ghiscoding/slickgrid-universal/blob/3c6ce204dd9b48091b4c49c5c07b5799b3af34b9/packages/common/src/interfaces/vanillaCalendarOption.interface.ts#L10-L15

~Should I assume that you'll soon go ahead with a PR? 😉~ Ah yeah I hadn't a chance to see all PRs yet 😆

You did use readonly though, should we use the same as Flatpickr or do you still prefer readonly? It might be a good idea to follow the same

ghiscoding avatar Sep 21 '24 04:09 ghiscoding

I didnt know about the FlatPickr option but agree that it should be kept as allowEdit and yep it should stay false as default for backwards compat. I'll update the PR with those info

zewa666 avatar Sep 21 '24 05:09 zewa666