elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.11k stars 377 forks source link

[BUG] Pressing enter on a focused button does not trigger an onclick event #523

Open AlecsFerra opened 2 years ago

AlecsFerra commented 2 years ago

Checklist before submitting an issue

Description of the bug

Title

Reproducing the issue

(defvar eww "eww -c $HOME/.config/eww/bat")

(defwindow batmenu
  :windowtype "normal"
  :stacking   "fg"
  :geometry
    (geometry
      :y      "30%"
      :width  "40%"
      :height "40%"
      :anchor "center top")
  (mainbox))

(defwidget mainbox []
  (eventbox
    :onhoverlost "${eww} close batmenu"
    (box
      :orientation  "h" 
      :space-evenly true
      (input
        :value "a"
        :onchange "notify-send {}")
      (button
        :onclick "notify-send A"
        "A")
      (button
        :onclick "notify-send B"
        "B"))))

Focus one of the button by tabbing and press enter

Expected behaviour

No response

Additional context

No response

AlecsFerra commented 2 years ago

Tell me if you want a PR: https://github.com/AlecsFerra/eww/commit/b001d005f3f3c5706a5903f337020976ad6016e4

Magnitudexx commented 1 year ago

I think this is a good idea

Magnitudexx commented 1 year ago

@elkowar what do you think?

AlecsFerra commented 1 year ago

@elkowar what do you think?

I'm waiting for him lol

SpomJ commented 1 year ago

try adding focusable, there was something about keyboard support with it

ModestTom commented 1 year ago

Lovely, works perfectly after compiling these changes with aur/eww-wayland 0.4.0-1 (+8 1.52). Thank you @AlecsFerra . Hope this gets added soon!

AlecsFerra commented 1 year ago

I think it won't happen since now the patch cannot't be automatically applied and the pr was made like 1 year ago.

ModestTom commented 1 year ago

@AlecsFerra That's unfortunate. I was able to add the changes manually and will continue to use it. Hopefully @elkowar will consider it at some point. Priorities and such

AlecsFerra commented 1 year ago

@AlecsFerra That's unfortunate. I was able to add the changes manually and will continue to use it. Hopefully @elkowar will consider it at some point. Priorities and such

If you want to share it by opening a PR with the changes on my repo if this feature will be considered we could just merge it directly to upstream.