From 2219b32bd6367d7ad700d0f4976934f29359fa67 Mon Sep 17 00:00:00 2001 From: jamesbaber1 <31859220+jamesbaber1@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:01:35 -0500 Subject: [PATCH] - change var name --- lightweight_charts/abstract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightweight_charts/abstract.py b/lightweight_charts/abstract.py index bf115bb..ea95553 100644 --- a/lightweight_charts/abstract.py +++ b/lightweight_charts/abstract.py @@ -856,17 +856,17 @@ class AbstractChart(Candlestick, Pane): for key in keys: # when there is no modifier key use the key value - key_event_condition = f"event.key === '{key}'" + condition = f"event.key === '{key}'" # if there is a modifier key if modifier_key: # use the key code instead key_code = 'Key' + key.upper() if isinstance(key, str) else 'Digit' + str(key) # change the condition to also require the modifier - key_event_condition = f"event.{modifier_key}Key && event.code === '{key_code}'" + condition = f"event.{modifier_key}Key && event.code === '{key_code}'" self.run_script(f''' {self.id}.commandFunctions.unshift((event) => {{ - if ({key_event_condition}) {{ + if ({condition}) {{ event.preventDefault() window.callbackFunction(`{modifier_key, keys}_~_{key}`) return true