When the app is turned off or switched, the keyboard becomes stuck or disappears - flutter

When I open a keyboard and then move my app to recent apps or switch, when I return, there is no keyboard on my screen but it occupies the area of the keyboard and appears a white area, and then the keyboard does not open and neither that portion goes until I remove that app and then reopen it. It is especially noticeable on iOS; the same project works perfectly on Android.
My project is in Flutter, and I am using GetX for state management.
The link to the video of the error is given below.
https://drive.google.com/file/d/1NcQGIdHkTRopWM3M33vM4XvKmyC59zHn/view?usp=share_link
I try adding "life cycle" and then adding these lines, but nothing happens.
FocusManager.instance.primaryFocus?.unfocus();
SystemChannels.textInput.invokeMethod('TextInput.hide');

Related

Flutter hot restart leaves my keyboard up and can't navigate

new to flutter here.
When testing with some APIs I have some text input and when it doesn't work I get the errors and that renders my screen inactive. The screen freezes when I have the keyboard up, and then when I restart the keyboard remains up. The issue is that I have a bottom navigation board and have just started the app. I'm sure I could change the default initial locations, however this is something that has bothered me for a while. Does anyone know why this is?
Screen freezes like this due to error
After hot restart screen
I assumed that a hot restart would restart the keyboard position as well. Perhaps I am doing something completely wrong.

Why does pressing up button in VS Code for Mac switch focus instead of taking me to the previous line

I have Googled this extensively and have got nowhere.
When I press the up button in VS Code for Mac, instead of taking me to the previous line, it sometimes, randomly, shifts focus to other areas, like the terminal, the notification symbol (bottom right), and file browser.
See screen recording attached.
https://www.youtube.com/watch?v=GdVtBcUV48o

Prevent Mac OS App window from stealing focus - Swift/Cocoa (GitHub Repo)

This is an open-source OS X app which displays lyrics of a song currently playing in a Music Player...
https://github.com/ddddxxx/LyricsX
It creates an NSScrollview/NSTextview window which displays lyrics, with this piece of code (correct me if i'm wrong) -
https://github.com/ddddxxx/LyricsX/blob/master/LyricsX/View/ScrollLyricsView.swift
The issue is, when the said Lyrics Window is placed in a Space
(Mission Control), the window will steal focus whenever you swipe to
another space (two finger swipe via mouse/trackpad or keyboard
shortcut) it will cause you to revert back to space containing the
Lyrics Window.
For example, if the lyrics window is on "Desktop 1" and you swipe to
"Desktop 2", the system will immediately switch back to "Desktop 1"
and bring the lyrics window in focus.
I'm quite new to Swift/Cocoa so I would love some help figuring out how to make sure the Lyrics window is NEVER in focus. I wouldn't mind outright disabling focus of the window entirely.
PS. Is this piece of code interfering/causing this behavior?
https://github.com/ddddxxx/LyricsX/blob/master/LyricsX/Controller/AutoActivateWindowController.swift

Horizontally scrolling NSCollectionView does not scroll until window resize

I have a horizontally scrolling NSCollectionView. The items are created but it is not scrollable until I manually resize the window in a horizontal direction. After that I scrolls fine. Does anybody know how to fix this? I looked at this question (question link) and tried the suggested solutions but I think its a different problem since it works after resizing the window.
EDIT:
The collection view is in a tableview cell. I have other collection views (although vertically scrolling and not in a tableview cell) in the same application and they work fine.
I solved it just by add this on my collectionView:
[self.yourCollectionView setFrameSize:self.yourCollectionView.collectionViewLayout.collectionViewContentSize];
I been experiencing similar issue for so many years and finally figured out that this is caused by Xcode.
When force quitting your application with Xcode (by ether clicking Run or Stop when application is running), Xcode saves the window's frame and restore it on next launch, even when your window is not configured to autosave its frame.
This is good for development but for some reasons, this causes the document view of the scroll view (mostly collection view) to not use the correct bounds in the next application run.
Manually setting collection view's frameSize as many people suggested doesn't always works. However, if you quit your application normally:
Click Application Menu and select Quit Application Name
Use keyboard shortcut ⌘Q
Right click on Dock icon and select Quit (with ⌥ or not)
Force quit in Force Quit Applications window (⌘⌥⎋)
...
Anything will works as you expected in the next application run (including launching from Xcode).

Google Chrome color picker isn't responding

Google Chrome color picker isn't responding. I tried re-installing and resetting Chrome. How can this be resolved?
"Reset devtools" doesn't fix the issue. I am not entirely sure what the exact cause of this bug is, but the only fix available will need to be done in an update. I could not find it in the code itself, although I didn't spend much time looking.
The main issue is that when your dev tools are docked to the bottom of the window, then the color picker will not show. It will load though, but the interface wont show. More than likely it is either in the wrong layer, or has some issue with its actual display, as no errors are thrown.
Anyway, the reason resetting dev tools works is because the default setting is to dock the dev tools to the right side of the screen (presumably, their testing showed most users use a wide screen, multiple screen, setup; as a result, there is room on the side of the screen).
If you, like me, use dev tools docked to the bottom, then in order to see the color picker, you need to change the dev tool temporarily to be docked to the right side of the screen. This does not require the settings to be reset, just simply change the docking position.
if your color picker not working on your mouse pointer, then you have to change your display settings, if your display settings are at scale 125 or more then your color picker won't work in any of the browsers, if you change your display setting to 100% your color picker will automatically start working
Changing the window size brings back the color picker. If the window is full screen size, get out of full screen size.
The solution that worked for me is:
Get out of full screen mode (Un-maximize window).
Reduce the window size, specially the width.
Docking the dev-tools to right side, Scaling the display, Lowering display resolution also brings the color-picker back as all of these affects the browser window size. Hopefully this bug will be addressed soon.
Open the inspect elements -> go to settings -> Preferences -> scroll down to the end you will see button "Restore defaults and reload" -> click on it and it will work
I had the same issue on Chrome 108.0.5359.98 on Arch for a long time now.
The problem was fixed by simply unchecking one of the experiments in DevTools - Settings - Experimets - Enable color picking outside the browser window.
scale your display settings to 100 % and again re scale to 125%(recommended).
For me chaning the Devtools zoom size worked not the webpage size.
Ctrl + Mouse wheel zooms in or out on the dev tools dock.
The problem is quite simple. You are unable to use the color picker because you have enabled the mobile view or any other device view
and, you got the answer, you just need to close the device toolbar and you are good to go.
Hope that works 😃