option-select ( option -- select/f )


Vocabulary
html5

Inputs
optionan object


Outputs
select/fan object


Definition


:: option-select ( option -- select/f )
option node-ancestors :> ancestors ancestors
[ "select" html-element-named? ] find nip :> select select [
ancestors select ancestors node-index head
:> parents parents [
{
[ html-element? ]
[ name>> { "option" "datalist" "hr" } member? ]
} 1&&
] any? parents [ "optgroup" html-element-named? ] count
1 > or [ f ] [ select ] if
] [ f ] if ;