tom-select icon indicating copy to clipboard operation
tom-select copied to clipboard

[Bug]: Dropdown input plugin puts id on wrong element

Open scott-8 opened this issue 1 year ago • 4 comments

Bug description

When the dropdown input plugin is used, it puts the label on the ts-control div rather than the input field. This causes issues when the field is labelled, as divs aren't allowed to have labels.

Expected behavior

I would expect the id (for example, ex-dropdown-input-ts-control) to be on the input field.

Steps to reproduce

  1. Go to the example for dropdown input in the docs (https://tom-select.js.org/plugins/).
  2. Inspect element.
  3. The id ex-dropdown-input-ts-control is on the ts-control div, rather than the input in the div.
  4. For the rest of the examples, the id is on the input as it should be.

Additional context

  • OS: Windows
  • Browser: Chrome

scott-8 avatar Jan 11 '24 23:01 scott-8

@oyejorge Hope that this will be fix ASAP.

I have a label with for="example" and the id="example" is set to the div with class ts-control instead of the input in it.

Ikpixel avatar Jan 31 '24 16:01 Ikpixel

I think the underlying issue is the same that I reported on #672 (self.focus_node set to the wrong element). There are more issues with dropdown input regarding focus. I'll look into and see if I can create a PR for both #672 and #679.

JoackimPennerup avatar Mar 12 '24 08:03 JoackimPennerup

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Jul 11 '24 02:07 github-actions[bot]

This issue has not been active in 120 days and has been marked "stale". Remove stale label or comment or this will be closed in 15 days

Issue still exists

scott-8 avatar Jul 11 '24 14:07 scott-8