Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart2js wrong implementation of onbeforeunload event #16215

Closed
DartBot opened this issue Jan 20, 2014 · 2 comments
Closed

dart2js wrong implementation of onbeforeunload event #16215

DartBot opened this issue Jan 20, 2014 · 2 comments
Labels
closed-as-intended Closed as the reported issue is expected behavior web-libraries Issues impacting dart:html, etc., libraries

Comments

@DartBot
Copy link

DartBot commented Jan 20, 2014

This issue was originally filed by igor.ko...@mailvision.com


What steps will reproduce the problem?

  1. open dart editor
  2. new application/web application (with generate sample content)
  3. add to main()
      window.onBeforeUnload.listen((e)=>"Good Bye");
  4. run it in Dartium mode and close tab, then run it as JavaScript and
    close tab

What is the expected output? What do you see instead?

in Dartium it works as should: pop up window with
"Confirm Navigation. Good Bye. Are you sure you want to leave this page" and buttons "Leave this Page" and "Stay on this Page"

in run as JavaScript page closed without the pop up window.

It's bug in window.onBeforeUnload implementation, because
if you replace it to:

import 'dart:js';

context["onbeforeunload"] = ((e)=>"Good Bye");

It works both in Dartium and run as JavaScript.

What version of the product are you using? On what operating system?
Dart SDK version 1.1.0-dev.5.11 Windows 7 64 bits

Please provide any additional information below.

@kasperl
Copy link

kasperl commented Jan 20, 2014

Added Area-HTML, Triaged labels.

@blois
Copy link
Contributor

blois commented Jan 21, 2014

Set returnValue on the BeforeUnloadEvent.
https://api.dartlang.org/docs/channels/be/latest/dart_html/BeforeUnloadEvent.html#returnValue


Added AsDesigned label.

@DartBot DartBot added Type-Defect web-libraries Issues impacting dart:html, etc., libraries closed-as-intended Closed as the reported issue is expected behavior labels Jan 21, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-intended Closed as the reported issue is expected behavior web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

4 participants