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

chore(deps): bump tom-select from 2.2.3 to 2.3.1 #11759

Merged
merged 4 commits into from
Jan 25, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 3, 2023

Bumps tom-select from 2.2.3 to 2.3.1.

Release notes

Sourced from tom-select's releases.

v2.3.0

Full Changelog: orchidjs/tom-select@v2.2.3...v2.3.0

Commits
  • 69180fa v2.3.1 Release
  • 2eecbfe rgba() instead of rgb(). Fixes #647
  • b02c3ce "include relevant error messages"
  • 6473bdd Merge branch 'master' of github.com:orchidjs/tom-select
  • dc7a1a6 HTMLSelectElement doesn't have readOnly attribute. Fixes #650
  • df86451 Merge pull request #649 from ravage84/patch-1
  • 190a21b Update copyright year
  • 6d11820 v2.3.0 Release
  • dceef1c remove jquery
  • 7bd39ea remove deprecated hideInput() and showInput()
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies javascript Pull requests that update Javascript code labels Nov 3, 2023
@rioug
Copy link
Collaborator

rioug commented Nov 5, 2023

Some of the changes broke some integration test that are using tom-select

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/tom-select-2.3.1 branch from 0b2fe63 to d01d4b3 Compare November 22, 2023 05:49
@dacook dacook self-assigned this Nov 23, 2023
@dacook
Copy link
Member

dacook commented Nov 23, 2023

I'm stuck and not sure how to continue. My notes so far..

I had a look at the customer selector on admin orders page, and can't work out what's wrong yet. That one uses a specific Stimulus controller:

The problem is with loading remote data.
It's showing "no results found" until you clear your search query, then the actual result shows.

  • No JS errors
  • HTTP requesting data successuflly

Screen Shot 2023-11-23 at 4 27 45 pm Screen Shot 2023-11-23 at 4 27 53 pm

Upgrade clues:

Comparing orchidjs/tom-select@v2.2.3...v2.3.0

  • showInput / hideInput removed ☑️ not used
  • removed jquery - is there any jquery methods being used?
  • changes to core
    • onInput (some code moved to _onInput )
    • now respects readonly ☑️ not used on customer_search_override
    • lots of other changes...

Issues: https://github.com/orchidjs/tom-select/issues

just one recent one open, but no obvious connection.
recent closed ones don't look related at first glance.

@rioug
Copy link
Collaborator

rioug commented Jan 8, 2024

Fixed the problem by using send_keys instead of set to populate the input. I believe set is not triggering what ever js event is required to trigger the search. I am not sure what is the change that broke this.

I also found a bug where customer search by first name doesn't work when creating a new order, it's fixed here #12015 and will need to be merged before we can merge this.

@rioug rioug force-pushed the dependabot/npm_and_yarn/tom-select-2.3.1 branch from 67695de to 4598c7c Compare January 15, 2024 03:30
dependabot bot and others added 2 commits January 23, 2024 11:52
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.2.3 to 2.3.1.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](orchidjs/tom-select@v2.2.3...v2.3.1)

---
updated-dependencies:
- dependency-name: tom-select
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Setting the value directly doesn't trigger the search, presumably
because it doesn't trigger any javascript event.
@rioug rioug force-pushed the dependabot/npm_and_yarn/tom-select-2.3.1 branch from 4598c7c to 270a310 Compare January 23, 2024 00:52
When using `tomselect_search_and_select` and searching isn't really
required it leaves the dropdown option open. It can then cause problem
when trying to interact with other element in the page. This happens
because clicking on the chosen option happena before the searching
finishes.
We can now use `tomselect_select` when searching is not actually
required.
It should not be a problem when search is required, as capybara will
wait for the option to appear on the page before clicking.
In these scenarios, searching for the option is not actually required,
we can directly click on the needed option. It prevent issue with
the dropdown option staying open and breaking specs.
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

I wonder in which case the browser would use set. Maybe when prefilling an input with historical data? That's probably not needed with a search input field but one could consider that a bug in tomselect. I don't think we care though. Or would accessibility aids like speech-to-text use set?

Comment on lines +108 to +109
def tomselect_select(value, options)
tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth being a bit more explicit with the options:

Suggested change
def tomselect_select(value, options)
tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper")
def tomselect_select(value, from:)
tomselect_wrapper = page.find("[name='#{from}']").sibling(".ts-wrapper")

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for fixing this one!
Maikel's suggestion looks good too, it could be applied to the other methods in that file also if you have the time.

@dacook
Copy link
Member

dacook commented Jan 24, 2024

Regarding the issue, am I right in saying it's a race condition, due to the input being filled in too early? In that case it sounds like a bug indeed.

@dacook
Copy link
Member

dacook commented Jan 25, 2024

I just remembered that Gaetan won't be online this week, so I think better just to proceed as-is.

Thanks to the testing, I think we can assume there's no regressions and merge without manual testing.

@dacook dacook merged commit c3914bc into master Jan 25, 2024
52 checks passed
@dacook dacook deleted the dependabot/npm_and_yarn/tom-select-2.3.1 branch January 25, 2024 05:26
@rioug
Copy link
Collaborator

rioug commented Jan 29, 2024

Regarding the issue, am I right in saying it's a race condition, due to the input being filled in too early? In that case it sounds like a bug indeed.

It's a race condition, but due to clicking on an option before the search actually finished. There is nothing really telling us the search is still happening, but a user is never as quick as Capybara so it's not really an issue. I guess it could be considered a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies javascript Pull requests that update Javascript code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants