Skip to content

Commit

Permalink
Allow enter key to submit genomic interval
Browse files Browse the repository at this point in the history
  • Loading branch information
pbong committed Aug 30, 2023
1 parent ee6d717 commit d089cae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions callbacks/homepage/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ def display_specific_analysis_page(nav_className, analysis_nav_id, analysis_layo
State('homepage-genomic-intervals', 'value'),
Input('homepage-submit', 'n_clicks'),
Input('homepage-genomic-intervals', 'n_submit'),
State('session-container', 'children'),
Input('homepage-reset', 'n_clicks'),
Input('homepage-clear-cache', 'n_clicks'),
prevent_initial_call=True
)
def parse_input(nb_intervals_str, n_clicks, dccStore_children, *_):
def parse_input(nb_intervals_str, n_clicks, n_submit, dccStore_children, *_):
if 'homepage-clear-cache' == ctx.triggered_id:
clear_cache_folder()

Expand All @@ -75,7 +76,7 @@ def parse_input(nb_intervals_str, n_clicks, dccStore_children, *_):

return dccStore_children, None, {'display': 'none'}, False, ''

if 'homepage-submit' == ctx.triggered_id and n_clicks >= 1:
if n_submit >= 1 or ('homepage-submit' == ctx.triggered_id and n_clicks >= 1):
if nb_intervals_str:
intervals = lift_over_util.get_genomic_intervals_from_input(
nb_intervals_str)
Expand Down
3 changes: 2 additions & 1 deletion pages/homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
id='homepage-genomic-intervals',
type='text',
value='',
debounce=True
debounce=True,
n_submit=0
),

html.Div([
Expand Down

0 comments on commit d089cae

Please sign in to comment.