Closed koichia closed 3 months ago
The problem is that I use neither GoRouter nor Firefox. :-) But considering that this plugin does nothing more than adds a <DIV>
to the HTML with a couple of drag-drop handlers attached, I'm not sure how it could cause this effect. Actually, you are allowed to add an onHover
handler as well but it's up to you to decide what happens, there's nothing on the JavaScript side but a callback (as I can see, you added nothing, all it's there is a debug print).
At first, you should try the original example, without GoRouter in Firefox to see if that works all right.
Thank you for the reply. Yes If I don't use GoRouter the it works as expected in Firefox. In my app I have a fair amount of packages loaded and the code I shared above is the minimum code I came up with that could reproduce the issue.
Since Dropzone and GoRouter did not change when Flutter 3.19.0 came out, the issue may well be somewhere in Flutter. Since I was in a bit of rush, I decided to use an alternative, super_drag_and_drop, which did not cause any rendering issues with Firefox. So for the time being I'll be using that one, but eventually it'll be great if I could go back to using Dropzone again since super_drag_and_drop is a bit overkill for my use case.
I was able to reproduce with app without go_router. It happened after flutter 3.19 and only in firefox
Okay that's great!
@Oleh-Sv Than could you just zip up a minimal sample for testing?
Hi,
I happened to find a simpler code to reproduce the issue in Firefox while I was working on something else. This time it doesn't even involve Dropzone, but just a single HtmlElementView. Since this happens without Dropzone, I should report it to the Flutter team instead.
import 'dart:ui_web' as ui_web;
import 'package:flutter/material.dart';
import 'package:web/web.dart' as web;
void main() => runApp(const HtmlElementViewExampleApp());
class HtmlElementViewExampleApp extends StatelessWidget {
const HtmlElementViewExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: MainApp(),
);
}
}
class MainApp extends StatefulWidget {
const MainApp({super.key});
@override
State<MainApp> createState() => _MainAppState();
}
class _MainAppState extends State<MainApp> {
int _selectedIndex = 0;
@override
void initState() {
super.initState();
ui_web.platformViewRegistry.registerViewFactory(
'test-html-view',
(int viewId) {
final divElement = web.HTMLDivElement();
divElement.style.width = '100%';
divElement.style.height = '100%';
divElement.style.backgroundColor = '#ffff00';
divElement.style.textAlign = 'center';
divElement.text = 'Text from DIV';
return divElement;
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Navigation Index: $_selectedIndex',
style: const TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
width: 100,
height: 20,
child: HtmlElementView(viewType: 'test-html-view'),
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
selectedItemColor: Colors.orange,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.business),
label: 'Business',
),
],
currentIndex: _selectedIndex,
onTap: (index) => setState(() {
_selectedIndex = index;
}),
),
);
}
}
Looks like the issue is already reported to Flutter. Like these:
Hopefully the fix is coming soon.
The Flutter version 3.19.6 is out and I confirmed that it works on Firefox now 🙌
Nice. Thank you.
Hello,
I'm encountering an issue on Firefox (version 123.0, the latest version at the time of testing) with Dropzone after upgrading Flutter version to 3.19.0 (before this, I was on 3.16.9 and it was working without any issues). This does not happen with Chrome or Edge. I'm not sure if the issue is with Dropzone but since in my app problem disappears when I remove Dropzone so I thought I'd report the issue here first.
The issue is that when I use Dropzone + Flutter 3.19.0 + GoRouter (NavigationRail) I get some exceptions and also the rendering becomes incorrect.
I have created this simple UI to replicate the issue (Navigation rails on the left, main contents on the right).![Screenshot 2024-02-19 205329](https://github.com/deakjahn/flutter_dropzone/assets/2694983/1f6c6fdc-6a27-4ec2-8783-20d261e83bae)
What happens is that on Firefox, when I hover around the left navigation icons, the icons becomes larger and appears broken.![Screenshot 2024-02-19 205256](https://github.com/deakjahn/flutter_dropzone/assets/2694983/24f17cac-4f55-48d1-b058-e7464ffae75a)
and then I get series of exceptions. For example:
The issue disappears when I remove Dropzone.![Screenshot 2024-02-19 215617](https://github.com/deakjahn/flutter_dropzone/assets/2694983/4d18d955-8616-42bc-bf79-606ecea9efe1)
This is the minimum code to reproduce this issue: main.dart.zip
Please let me know if I should report this to the Flutter team first. Thank you!