Skip to content

Class names can't contain spaces #832

@mokhosh

Description

@mokhosh

Describe the bug
You can't add multiple classes and separate them with spaces. This is what you get:

Uncaught (in promise) DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided ('bg-gray-200 p-1') contains HTML space characters, which are not valid in tokens

So you can't style this with tailwind. Or keep the original class and add a bootstrap class to it. The strange thing is you can do this for container and containerOuter but nothing else.

To Reproduce
Steps to reproduce the behavior:

new Choices(element, {
  itemSelectText: '',
  removeItemButton: true,
  classNames: {
    containerOuter: 'choices bg-gray-200 focus:bg-gray-100 focus:shadow shadow-inner appearance-none rounded w-full text-gray-700 leading-tight',
    containerInner: 'py-1 px-3',
    input: 'bg-gray-200 p-1',
  },
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions