Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
harana-bot committed Mar 5, 2024
1 parent 2ee742f commit 27f228c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ class SearchKeyHandler extends ActionHandler(zoomTo(_.searchState)) {
action(SelectNextDocument)

case Keys.Up =>
if (event.getModifierState("Control") || event.getModifierState("Meta"))
action(SelectDocument(documents.head.id, true))
if (value.selectedDocument.get == documents.head)
action(SearchFocused)
else
action(SelectPreviousDocument)
if (event.getModifierState("Control") || event.getModifierState("Meta"))
action(SelectDocument(documents.head.id, true))
else
action(SelectPreviousDocument)

case Keys.Left =>
action(
Expand Down Expand Up @@ -177,7 +180,7 @@ class SearchKeyHandler extends ActionHandler(zoomTo(_.searchState)) {
if (hasVerticalCards)
action(if (cardState.middleVerticalIndex > 0) SelectVerticalTopCard else SelectPreviousDocument)
else
action(SelectPreviousDocument)
action(SearchFocused)

case Keys.Left =>
action(SelectHorizontalLeftCard) + action(if (cardState.middleHorizontalIndex == 0) UpdateFocusedPanel(Panel.Document) else NoChange)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ import scala.scalajs.js.JSConverters._
window.addEventListener("keyup", keyUpListener, false)
window.onblur = (_: FocusEvent) => Circuit.dispatch(Hide)

window.onfocus = (_: FocusEvent) => {
val state = Circuit.state(_.searchState, false)
if (state.focusedPanel != Panel.Search) {
inputRef.current.blur()
}
}
if (inputRef.current != null)
inputRef.current.blur()

// TODO: Add preference
// Circuit.dispatch(
Expand Down

0 comments on commit 27f228c

Please sign in to comment.