admin-portal icon indicating copy to clipboard operation
admin-portal copied to clipboard

Should honor browser's current focus state

Open lonix1 opened this issue 4 years ago • 10 comments

What version of Invoice Ninja are you running? ie v4.5.25 / v5.0.30 5.1.47

What environment are you running? Docker

Have you checked log files (storage/logs/) Please provide redacted output n/a

Have you searched existing issues? yes

Have you reported this to Slack/forum before posting? no

Describe the bug IN does not honor browser's current focus state

Steps To Reproduce Easiest to see with a multiple-monitor setup if you have one, if not then open a browser and some other app side by side.

  • go to any create/edit form, click in any field
  • notice cursor is blinking
  • switch to other app so it captures focus
  • notice cursor is blinking in other app
  • bug: cursor is still blinking in IN form field

Why is this a problem? It breaks the cursor metaphor ("this field has focus"). And more importantly, because of that issue, I made the mistake of assuming I'm typing in IN, whereas I was actually typing into a different app (or vice versa). This may cause nasty/surprising problems.

Expected behavior When the browser loses focus, IN should release focus too - it could listen for the on/off focus events in javascript.

Screenshots no

Additional context no

(v5) Can you replicate the issue on our demo site? https://demo.invoiceninja.com yes

lonix1 avatar Apr 20 '21 11:04 lonix1

Hi,

I'm not sure I understand this, I don't see a difference in behavior between IN and Gmail?

hillelcoren avatar Apr 20 '21 11:04 hillelcoren

Sorry I don't use gmail so don't know. Are you saying that gmail form fields remain blinking even if the browser doesn't have focus? (So for example you could have "focus" blinking in both gmail forms and in microsoft word at the same time)

If so that's really! weird and contrary to norms on windows and linux desktops. I'm not sure about macs.

You've undoubtedly seen this in other desktop apps - maybe I didn't explain myself properly? I'll try find a video or something to illustrate what I mean.

lonix1 avatar Apr 20 '21 11:04 lonix1

I see what you mean about the blinking cursor, does it cause any problems other than possibly being visually distracting?

hillelcoren avatar Apr 20 '21 11:04 hillelcoren

Yes, e.g.:

  • I had IN which "pretends" it has focus, and Excel which also has a blinking cursor (because it actually had focus)
  • I looked away for a moment, looked back and assumed IN had focus
  • So started to type... whilst overwriting data in Excel, which is the window that actually had focus
  • I didn't realize this... and couldn't understand why even though "IN has focus" (the cursor was blinking after all) I couldn't type into it, so I moved the mouse around frantically, clicked the browser and continued with IN, unaware of what I'd done
  • Later, after saving the excel file, I saved erroneous data (no worries I just alt-z)

I expect this exact user "journey" will occur to many people - at least those with multiple monitors, or who have two windows side by side (eg on a widescreen).

lonix1 avatar Apr 20 '21 12:04 lonix1

Thanks, that makes sense. I'll look into it..

hillelcoren avatar Apr 20 '21 12:04 hillelcoren

If you're working on a single non-wide monitor - perhaps most people? - then this problem exists but won't manifest.

I think many though who deal with finances will have multiple windows open. The bookkeeper at my last job had more monitors than me, and I'm a dev! (Yes that's called jealousy :smile: )

lonix1 avatar Apr 20 '21 12:04 lonix1

I believe this is the underlying issue, if you'd please upvote the issue it helps get it noticed

https://github.com/flutter/flutter/issues/21193

hillelcoren avatar Apr 20 '21 12:04 hillelcoren

Done.

You might consider creating a pinned thread on the forums site with a list of upstream issues to be upvoted - I saw something similar in another open source app, can't remember which though.

Many of the users on the forums are also devs, so they have github accounts, and if you ask them to lend support they will.

lonix1 avatar Apr 20 '21 12:04 lonix1

Thanks for the suggestion, that's a good idea!

hillelcoren avatar Apr 20 '21 12:04 hillelcoren

FYI.. I've created a label for now:

https://github.com/invoiceninja/admin-portal/issues?q=is%3Aissue+is%3Aopen+label%3Aflutter

hillelcoren avatar Apr 20 '21 12:04 hillelcoren