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

set null if empty, feature request #125

Open
pmingkr opened this issue Jul 19, 2023 · 1 comment
Open

set null if empty, feature request #125

pmingkr opened this issue Jul 19, 2023 · 1 comment

Comments

@pmingkr
Copy link

pmingkr commented Jul 19, 2023

Version

cdn latest

Development Environment

Windows, Chrome

Current Behavior

if the input is empty it returns to the previous value.

Expected Behavior

if the input is empty it becomes the null date.
or has the option for it.

@pmingkr pmingkr changed the title set null if empty set null if empty, feature request Jul 19, 2023
@pmingkr
Copy link
Author

pmingkr commented Jul 19, 2023

current my solution

var input = /* input for datepicker */;
var tuiDatePicker = new tui.DatePicker(/* args */)
  input.addEventListener(
    "change",
    (ev) => {
      if (input.value === '') {
        tuiDatePicker.setNull();
      }
    },
    true
  );

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

No branches or pull requests

1 participant