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

Datepicker with manual input #1684

Closed
3 tasks done
zewa666 opened this issue Sep 18, 2024 · 2 comments · Fixed by #1685
Closed
3 tasks done

Datepicker with manual input #1684

zewa666 opened this issue Sep 18, 2024 · 2 comments · Fixed by #1685

Comments

@zewa666
Copy link
Contributor

zewa666 commented Sep 18, 2024

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

  • Follow our Code of Conduct
  • Read the Wikis.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@ghiscoding
Copy link
Owner

ghiscoding commented Sep 21, 2024

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.

describe('isValueChanged method', () => {
it('should return True when date is changed in the picker', () => {
// change to allow input value only for testing purposes & use the regular flatpickr input to test that one too
mockColumn.editor!.editorOptions = { allowInput: true, altInput: false };
mockItemData = { id: 1, startDate: '2001-01-02T11:02:02.000Z', isActive: true };

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

export interface VanillaCalendarOption extends IPartialSettings {
//-- extra options used by SlickGrid
/** defaults to false, do we want to hide the clear date button? */
hideClearButton?: boolean;
}

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

@zewa666
Copy link
Contributor Author

zewa666 commented Sep 21, 2024

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 zewa666 closed this as completed Sep 23, 2024
zewa666 added a commit to zewa666/slickgrid-universal that referenced this issue Sep 23, 2024
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

Successfully merging a pull request may close this issue.

2 participants