fix #1493

Appears to fix https://github.com/ivaynberg/select2/issues/1493.  Probably not the best way of getting the value.