-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
Description
On PointerEvents, if you look at clientX or clientY it returns an int type, but the value is a double. So it will throw an error if you try to do anything with it.
Example to put into Dartpad to show the issue:
import 'dart:js_interop';
import 'package:web/web.dart';
void main() {
window.document.addEventListener(
'pointerdown',
((Event event) {
final e = event as PointerEvent;
print('clientX: ${e.clientX}');
}).toJS,
);
}
Example error:
Uncaught Error, error: Error: TypeError: 317.375: type 'double' is not a subtype of type 'int'
This was tested with Dart SDK 3.11.1 with web 1.1.1 and also with DartPad using 3.11.0
Reactions are currently unavailable