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

Combobox documentation example #30948

Open
JohnRDOrazio opened this issue Apr 18, 2021 · 1 comment
Open

Combobox documentation example #30948

JohnRDOrazio opened this issue Apr 18, 2021 · 1 comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers

Comments

@JohnRDOrazio
Copy link
Contributor

The example code given for the Combobox component needs to be updated, onInputChange I believe should be onFilterValueChange. Related to #29566 and #28492.

If I define onInputChange as in the example, I get the console error Uncaught TypeError: onFilterValueChange is not a function. If I define onFilterValueChange instead of onInputChange I no longer get the error.

And I see that the onChange event on the component is calling onInputChange:


which in turn is calling onFilterValueChange:
onFilterValueChange( text );
.
onFilterValueChange however doesn't have an internal definition but depends on whatever function is passed to it, whereas onInputChange has it's own internal definition so I believe shouldn't be overridden?

Basically I'm pretty sure the example needs to be updated from onInputChange to onFilterValueChange in the component parameters.

@Mamaduka Mamaduka added [Package] Components /packages/components [Type] Developer Documentation Documentation for developers labels Apr 19, 2021
@bosconian-dynamics
Copy link
Contributor

Related: WPSE #385474 - the user who posed the question had no idea of onFilterValueChange's existence, let alone that it was required as the documentation presents it as optional.

The WPSE question took three months to resolve because the error as presented was obfuscated due to the lack of sourcemaps in core and/or plugin distributions of Gutenberg - see #15732. The error that the developer received was "p is not a function".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

3 participants