dojo / framework

Dojo Framework. A Progressive Framework for Modern Web Apps
https://dojo.io/
Other
580 stars 79 forks source link

Native select renders inappropriate `value` attributes #251

Closed maier49 closed 5 years ago

maier49 commented 5 years ago

Bug

When passed a simple array of strings as the options property, the native mode of Select is rendering value attributes on each child option tag. This results in every selection being interpreted as setting the select to "". As a result the onChange handler is not fired and the select's value does not properly update.

Package Version: 5.0.2

Code

w(Select, { 
  options: ['foo', 'bar'],
  useNativeElement: true
});

Expected behavior:

The value attribute should be empty in this case so the text of the option element is used as the value. Actual behavior:

A value attribute with no value is being added to each option, causing the select to have incorrectly.

maier49 commented 5 years ago

Opened this in the wrong repository 😅