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

calling withValue(null) on a Select should clear it #960

Closed
howudodat opened this issue Sep 16, 2024 · 0 comments
Closed

calling withValue(null) on a Select should clear it #960

howudodat opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Milestone

Comments

@howudodat
Copy link

Describe the bug
calling withValue(null) on a Select should clear it

Expected behavior
I should be able to call setValue() or withValue() and pass in no selection which clears any selection

Proposed change:

  /**
   * Sets the value for the select. Optionally, it can notify listeners based on the provided silent
   * flag.
   *
   * @param value The new value to set.
   * @param silent If true, change listeners will not be notified.
   * @return an instance of the concrete class.
   */
  @Override
  public C withValue(V value, boolean silent) {
    if (value == null) 
      return clear(silent);
      
    V oldValue = getValue();
    if (!Objects.equals(value, oldValue)) {
      doSetValue(value);
      if (!silent) {
        triggerChangeListeners(oldValue, getValue());
      }
    }
    autoValidate();
    return (C) this;
  }
@vegegoku vegegoku self-assigned this Sep 17, 2024
@vegegoku vegegoku added the bug Something isn't working label Sep 17, 2024
@github-project-automation github-project-automation bot moved this to To do in Domino UI Sep 17, 2024
@vegegoku vegegoku added the version 2.x.x Version 2.x.x issues label Sep 17, 2024
@vegegoku vegegoku added this to the 2.0.3 milestone Sep 17, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Domino UI Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants