selectize.js icon indicating copy to clipboard operation
selectize.js copied to clipboard

Scroll left when I click on a selectized item and page is scrolled right

Open Bonten156 opened this issue 3 years ago • 1 comments

I did:

  • [x] Search for if my issue has already been submitted
  • [x] Make sure I'm reporting something precise that needs to be fixed
  • [x] Give my issue a descriptive and concise title
  • [x] Create a minimal working example on JsFiddle or Codepen (or gave a link to a demo on the Selectize docs)
  • [x] Indicate precise steps to reproduce in numbers and the result, like below

When I click on an option and if the page is scrolled right, there is a scroll left. With remove_button plugin, if I click on the cross, there is a scroll too and item is not removed.

Steps to reproduce:

  1. go to https://selectize.dev/plugins/2020/01/01/remove-button-copy/
  2. Add margin to example div like below and scroll to the right :

image

  1. Try to remove one item

Expected result: Item is removed

Actual result: page scroll left and item is not removed

Bonten156 avatar Jun 13 '22 10:06 Bonten156

If I remove the line self.$control_input[0].focus(); in Selectize.focus(), It seems to work well.

Bonten156 avatar Jun 13 '22 12:06 Bonten156

After having updated, the problem seems to be not fully fixed.

Doing the same as described, the first click on a remove button will jump to the left. After as there is focus on a tag, clicking on the remove button will work and not jump.

If I don't click on the cross but on the item, it jump left too.

Bonten156 avatar Nov 16 '22 09:11 Bonten156