~mearaj


#415 WASM key.InputOp behaves inconsistently 8 months ago

Comment by ~mearaj on ~eliasnaur/gio

Hi, I have submitted PR against this issue.
I would like to mention few notes and thoughts here regarding this issue.
I am not 100% sure, but the most probable cause of this issue seems to be iframes and focus.
The issue is that I couldn't find gio tackling the main root element(browser window)
but what I observed is that gio windows were created inside the iframe.
I tried to debug the window and observed that even after adding event listener
to gio's window input tarea, it wasn't receiving any key events.
During debugging I tried to set the gio's input tarea to focus and it started listening to key events.
Also after registering the key event key.InputOp{Tag: tag, Keys: "A"}.Add(ops), when I ran first click the
rectangle box, the browser's console shows this message key.FocusEvent{Focus:false} from wasm.js file line no 28
console.log(outputBuf.substring(0, nl));.
In the subsequent clicks, this message doesn't appear.
Currently this PR resolves the issue but I still believe that there must be a better solution for this, because
in the current fix, browser's window listen's to key event and dispatches it from gio's window's input tarea element
where as during debugging I found that if tarea element is set to focus, then it tackles key input event without applying any other fix.
Thanks :)

#511 Button Focus Sticks 9 months ago

Comment by ~mearaj on ~eliasnaur/gio

Here is the interesting blog on the behavior of button's focus in different browsers. I think, the better solution for us in the current situation would be to leave the styling of focused button with the api user, instead of applying default brighter style. (Note: I am implying only for focus and not for other states like hovered, touched, clicked).

#511 Button Focus Sticks 9 months ago

on ~eliasnaur/gio

"~mearaj" outgoing@sr.ht writes:

Not sure, but I think the click behavior shouldn't make button focused and just tab should do that.

The correct behavior probably differs between platforms (desktop vs mobile), or between input methods (mouse vs touch screen).

On desktop systems with mice, it's quite normal for buttons to receive focus the moment they have been depressed (i.e. on the press event, not even requiring a full click.)

I can't speak to any touch screen behavior, though.

#511 Button Focus Sticks 9 months ago

Comment by ~mearaj on ~eliasnaur/gio

Not sure, but I think the click behavior shouldn't make button focused and just tab should do that.

#421 Dynamic Border Radius. 1 year, 10 months ago

Comment by ~mearaj on ~eliasnaur/gio

I do agree with ~egonelbre, it's a useful feature but not frequently required and creating a separate repository where may be infrequent but useful and helpful gio widgets resides.

#410 Textfield Focus/Input issues on Android. 1 year, 11 months ago

Comment by ~mearaj on ~eliasnaur/gio

I have submitted. Thanks :)

#410 Textfield Focus/Input issues on Android. 1 year, 11 months ago

Comment by ~mearaj on ~eliasnaur/gio

Ok.
I will submit and let you know.
Thanks a lot :)

#410 Textfield Focus/Input issues on Android. 1 year, 11 months ago

Comment by ~mearaj on ~eliasnaur/gio

Hi ~eliasnaur, shall I submit a patch or expect it to be done from your side?
Whatever you say :)
Thanks a lot for helping me out with small steps and best practices :)

#410 Textfield Focus/Input issues on Android. 1 year, 11 months ago

Comment by ~mearaj on ~eliasnaur/gio

Sorry for the duplicate comments, Not sure how it happens. Anyways, here is the code, after your suggestions

isMobile := runtime.GOOS == "ios" || runtime.GOOS == "android"
switch {
case e.Name == key.NameTab && e.Modifiers == 0:
	w.moveFocus(router.FocusForward, d)
case e.Name == key.NameTab && e.Modifiers == key.ModShift:
	w.moveFocus(router.FocusBackward, d)
case e.Name == key.NameUpArrow && e.Modifiers == 0 && isMobile:
		w.moveFocus(router.FocusUp, d)
case e.Name == key.NameDownArrow && e.Modifiers == 0 && isMobile:
		w.moveFocus(router.FocusDown, d)
case e.Name == key.NameLeftArrow && e.Modifiers == 0 && isMobile:
		w.moveFocus(router.FocusLeft, d)
case e.Name == key.NameRightArrow && e.Modifiers == 0 && isMobile:
		w.moveFocus(router.FocusRight, d)
default:
	handled = false
}

#410 Textfield Focus/Input issues on Android. 1 year, 11 months ago

Comment by ~mearaj on ~eliasnaur/gio

Hi, thanks a lot for helping, yeah that is much better, will do that and get back to you. :)