Skip to content

Advanced Select removeOption doesn't work after update #417

Closed
@umaraziz0

Description

@umaraziz0

Summary

Advanced Select add & remove options don't work after update

Steps to Reproduce

Tried using the example component in the docs

  1. Click "Add Three Options" button
  2. Click "Remove values 5,6,7" button
  3. View console for error

Demo Link

https://preline.co/docs/advanced-select.html#add-remove-options

Expected Behavior

  • The removeOption should work as intended.
  • No console.log messages should be shown, especially in production.

Actual Behavior

  • console.log messages are shown, seems to be and the affected option's val values and false
  • The console throws an error: Uncaught TypeError: Cannot read properties of null (reading 'length') and doesn't do anything else.

Seems to occur in single select dropdowns, the multiple select example in the docs has no issue.

This also happens in one of my projects, when I tried upgrading the package version due to this bug: #414 , where in my case no items are removed.

Preline version: ^2.4.1
Chrome version: Version 126.0.6478.185 (Official Build) (arm64)

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions