If you were creating a `dropdown/select` in React, is there any reason you wouldn’t allow for an `onClick` handler if there were scenarios where it were warranted? I appreciate that a `dropdown/select` is sensitive to the `onChange` handler, but I’ve identified a scenario where, for instance, clicking on a `dropdown/select` should trigger an error message based on whether another field has not been completed within a form. Some are telling me to bind the `onClick` handler to a DIV or something, but that seems odd. What’s more is, the `onClick` handler does not prefer the `onChange` from working–it just allows me to perform some other action based entirely upon the user clicking the dropdown.
Is there any sound reason that I wouldn’t add the `onClick` handler directly to the `dropdown/select`?
submitted by /u/IanAbsentia
[link] [comments]