# Upgraded from canjs 2.2.5 to canjs 2.3.28 and jquery v1.11.3 to jquery v3.4.1 and select box selection is not working

**URL:** <https://forums.bitovi.com/t/upgraded-from-canjs-2-2-5-to-canjs-2-3-28-and-jquery-v1-11-3-to-jquery-v3-4-1-and-select-box-selection-is-not-working/1100>\
**Category:** CanJS\
**Created:** [January 13, 2020, 8:54pm UTC](https://forums.bitovi.com/t/upgraded-from-canjs-2-2-5-to-canjs-2-3-28-and-jquery-v1-11-3-to-jquery-v3-4-1-and-select-box-selection-is-not-working/1100 "2020-01-13T20:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smoothlikejazz](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/smoothlikejazz/32/461_2.png) [@smoothlikejazz](https://forums.bitovi.com/u/smoothlikejazz)\
**Post date:** [January 13, 2020, 8:54pm UTC](https://forums.bitovi.com/t/upgraded-from-canjs-2-2-5-to-canjs-2-3-28-and-jquery-v1-11-3-to-jquery-v3-4-1-and-select-box-selection-is-not-working/1100/1 "2020-01-13T20:54:22Z")

</div>

@justinbmeyer We have a helper function which creates the select box based on observe array of label-value pairs [{“label”: “”, value:“”}, {“label”: “”, value:“”}] and it also calls $option.attr(“selected”, “selected”) and $option.prop(“selected”, true) when label-value pairs value matches selected value. This approach used to work in canjs 2.2.5 but after upgrade to 2.3.28 it is not working.

The selected attribute on the option is getting set correctly but selection is not happening. see screenshot

 ![empty_select](https://canada1.discourse-cdn.com/flex035/uploads/donejs/original/1X/12e47b0d9779fa9bd05f7f0c49ea26a481c9df84.png)

**It works**

1. When I pass a serialized array of label-value pairs instead of observer array of label-value pairs  
Or
2. If we call $option.attr(“selected”, “selected”) within setTimeout with a delay of 500 it works, even with the observable array of label-value pairs

Below are screenshot of array of label-value pairs before and after upgrade

I am not sure how observe array of label-value pairs is causing selection not work

 ![comparison of constructor to map](https://canada1.discourse-cdn.com/flex035/uploads/donejs/original/1X/b320e452d0fa5ac16df75fc1787c0df4923d9b3b.png)

Were not sure how observable array is interfering with option selection

---

<div class="post-metadata">

**Author:** ![cherif\_b](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/cherif_b/32/31_2.png) [@cherif\_b](https://forums.bitovi.com/u/cherif_b)\
**Post date:** [January 14, 2020, 6:21pm UTC](https://forums.bitovi.com/t/upgraded-from-canjs-2-2-5-to-canjs-2-3-28-and-jquery-v1-11-3-to-jquery-v3-4-1-and-select-box-selection-is-not-working/1100/2 "2020-01-14T18:21:58Z")

</div>

Hi @smoothlikejazz,

Thank you for reporting, we are taking a look at this issue, we will let know if something pops up.

---

<div class="post-metadata">

**Author:** ![cherif\_b](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/cherif_b/32/31_2.png) [@cherif\_b](https://forums.bitovi.com/u/cherif_b)\
**Post date:** [January 17, 2020, 5:08pm UTC](https://forums.bitovi.com/t/upgraded-from-canjs-2-2-5-to-canjs-2-3-28-and-jquery-v1-11-3-to-jquery-v3-4-1-and-select-box-selection-is-not-working/1100/3 "2020-01-17T17:08:37Z")

</div>

@smoothlikejazz do you have a demo that shows a use-case about the error?  
It will be great if you can share with us a github repo that help to understand the issue.

Thank you!
