Skip to content

Commit

Permalink
$mol_select_list do not close
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Sep 30, 2023
1 parent 801c99b commit adf2555
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions form/draft/demo/demo.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ $mol_form_draft_demo $mol_example
<= Friends_field $mol_form_field
name \Friends
Content <= Friends $mol_select_list
pick_enabled true
showed => friends_showed
dictionary <= friends_suggestions *
jocker \Jocker
harley \Harley Quinn
Expand Down
6 changes: 6 additions & 0 deletions form/draft/demo/demo.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ namespace $.$$ {
super.publish()
this.result( this.message_done() )
}

override friends_suggestions() {
if (! this.friends_showed()) return {}
this.$.$mol_wait_timeout(1000)
return super.friends_suggestions()
}

}
}
3 changes: 2 additions & 1 deletion select/list/list.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ $mol_select_list $mol_view
click?event <=> remove*?event null
hint <= badge_hint @ \Drop
enabled <= drop_enabled <= enabled true
filter_auto_clean true
sub /$mol_view
<= Pick $mol_select
showed? <=> showed? false
event_select*? <=> event_select*? null
align_hor <= align_hor \right
options <= options_pickable <= options /string
value? <=> pick? \
Expand Down
12 changes: 5 additions & 7 deletions select/list/list.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ namespace $.$$ {
if( !key ) return ''
this.value([ ... this.value() , key ])

new $mol_after_frame(()=> {
if( !this.pick_enabled() ) return
if (this.filter_auto_clean()) this.Pick().filter_pattern( '' )
this.Pick().Trigger().focused( true )
this.Pick().open()
})

return ''
}

override event_select( id : string , event? : MouseEvent ) {
event?.preventDefault()
this.pick( id )
}

@ $mol_mem
override options() {
return Object.keys( this.dictionary() ) as readonly string[]
Expand Down

0 comments on commit adf2555

Please sign in to comment.