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

Selecting checkbox on index page with Action and no search query throws JS error #861

Closed
2 tasks done
schmidtg opened this issue Apr 24, 2022 · 0 comments
Closed
2 tasks done

Comments

@schmidtg
Copy link
Contributor

schmidtg commented Apr 24, 2022

Describe the bug

Selecting a checkbox for a record on an index page with an Action throws a JS error for a resource that has no search query defined.

Steps to Reproduce

  1. Create a resource that has no search query defined (default).
  2. Create an action for that resource.
  3. Click on that resource in sidebar.
  4. Click on a checkbox to select a record.
  5. See error in JS console.

Expected behavior

No JS error should be thrown.

Actual behavior

Throws following console error:

stimulus.js:1658 Error invoking action "input->item-selector#toggle"

TypeError: Cannot read properties of null (reading 'dataset')
    at n.set currentIds [as currentIds] (item_selector_controller.js:31:29)
    at n.addToSelected (item_selector_controller.js:58:10)
    at n.toggle (item_selector_controller.js:71:12)
    at JQ.invokeWithEvent (stimulus.js:278:25)
    at JQ.handleEvent (stimulus.js:260:18)
    at KQ.handleEvent (stimulus.js:31:25)

System configuration

Avo version: 2.3.0

Rails version: 7.0.2.3

Ruby version: 2.7.2p137

Screenshots

Screen Shot 2022-04-24 at 7 09 07 AM

Additional context

I was relying on performing an action on multiple resources and realized the IDs weren't being submitted. The immediate JS error was the toggle. And the secondary issue were the IDs not being submitted in a form for use in an action.

Impact

  • Low impact

Urgency

  • low urgency
@schmidtg schmidtg changed the title Selecting checkbox on index page with no search throws JS error Selecting checkbox on index page with Action and no search query throws JS error Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants