Error when enableDoubleTapViewing equals false in pdf with keyboard losing focus.
In some of my forms, there are fields that will automatically lose keyboard focus when tapped. This only happens when enableDoubleTapZooming is set to false in the PDF viewer though.
See the video for video evidence. The field that loses focus here is "Special Notes" at the bottom. Other forms have this issue in other fields as well that are multiline, and some that are not.
At the end of the video you see the field getting focus. This is because I double tapped the field. After double tapping the field, the keyboard is able to get focus. Then anytime after that, the field only requires a single tap.
See code below for the minimal reproducible code. The pdf used is included in the zip. This was done on an iPad with iPadOS 17.
video: https://youtu.be/uuEBgFXFV1o
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
void main() {
runApp(
MaterialApp(
title: 'Title',
home: Scaffold(
body: SfPdfViewer.asset(
'assets/claim_questionnaire.pdf',
enableDoubleTapZooming: false,
),
),
),
);
}
Attachment: claim_questionnaire.pdf_84a690f1.zip
Hi Jeremy Isenburg,
We are able to replicate the issue that the multi-line textbox form field loses focus immediately after the soft keyboard rises.
Currently, we are validating this issue, and we will update further details on May 22, 2024.
Regards,
Imman Kumar P
Thanks for the update.
Also note that I have observed this happening on non-multiline fields as well. But it doesn't always happen so I can't get a good reproduction. Maybe it is the same fix though.
Hi Jeremy Isenburg,
While checking for the root cause of this issue, we have found the issue is from the Flutter framework. And we have created an issue in the flutter repository.
Please find the issue link below. https://github.com/flutter/flutter/issues/148855
We will update further details once we receive any solution or suggestions for this issue.
Regards,
Imman Kumar P
Hello,
The issue was closed without a reply from you guys. Could you confirm this was fixed or not?
https://github.com/flutter/flutter/issues/148855#issuecomment-2131413223
Hi Jeremy Isenburg,
Sorry for the inconvenience caused.
The suggestions provided in the issue are not working for SfPdfViewer. Currently, we are validating this issue and will provide further details on July 17, 2024.
Regards,
Imman Kumar P
Hi Jeremy Isenburg,
We have confirmed that the "soft keyboard hides immediately when tapped on a multi-line text box form field" is a defect in our product and have logged a report for it. The fix for the same will be included in the July 30, 2024, weekly release.
Please use the feedback link to track the status of the bug,
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Imman Kumar P
Hi Jeremy,
We have resolved the
issue "soft keyboard hides immediately when tapped on a multi-line text
box form field", and the fix for the same is available in our latest
weekly release.
Package link: syncfusion_flutter_pdfviewer 26.2.7
Root cause: We rely on the FocusNode.rect property to determine whether the tapped position is outside the TextFormField widget to unfocus the TextFormField widget. However, this property has an incorrect value for our use case. We have now calculated the global position of the TextFormField widget using the bounds property and the localToGlobal method.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Imman Kumar P
Thanks, this works now.
We are glad that the issue is resolved. We are marking this ticket as solved.
- 9 Replies
- 2 Participants
- Marked answer
-
JI Jeremy Isenburg
- May 18, 2024 09:00 PM UTC
- Aug 6, 2024 08:14 AM UTC