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

[Bug]: Plugin documentation provides incorrect instructions #824

Open
JackAtOmenApps opened this issue Dec 3, 2024 · 0 comments
Open

[Bug]: Plugin documentation provides incorrect instructions #824

JackAtOmenApps opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JackAtOmenApps
Copy link

JackAtOmenApps commented Dec 3, 2024

Bug description

The first example on the docs page for including plugins shows:

import TomSelect from 'tom-select/base';
import TomSelect_remove_button from 'tom-select/plugins/remove_button.js';
import TomSelect_dropdown_header from 'tom-select/dropdown_header.js';

TomSelect.define('remove_button', TomSelect_remove_button);
TomSelect.define('dropdown_header', TomSelect_dropdown_header);

But looking at the package.json file and the actual directories, I had to do this:

import TomSelect from 'tom-select/base';
import TomSelect_remove_button from 'tom-select/plugins/remove_button/plugin.js';
import TomSelect_dropdown_header from 'tom-select/dropdown_header/plugin.js';

TomSelect.define('remove_button', TomSelect_remove_button);
TomSelect.define('dropdown_header', TomSelect_dropdown_header);

Expected behavior

I would expect to be able to copy-paste from the docs and successfully build. But the directions seem to be slightly incorrect.

Steps to reproduce

See above

Additional context

  • OS: Ubuntu 24.04
  • NPM (LTS)
  • tom-select ^2.4.1

I am no JavaScript expert, so if I am misunderstanding something, or if there is a better approach than what I recommended here, please let me know.

@JackAtOmenApps JackAtOmenApps added the bug Something isn't working label Dec 3, 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
Projects
None yet
Development

No branches or pull requests

1 participant