Hi,

This better select is pretty nice although it could use some more support for other stuff.

For example this check is awful, a lot of things use non numeric value's as keys!
You really should support that to be good.

    // We now check that the element's options are correct. If they're not in
    // the right format, we abort.
    foreach($element['#options'] as $key => $val) {
      if (!is_numeric($key) || !is_string($val)) {
        return $element;
      }
    }