Closed Bug 920942 Opened 11 years ago Closed 11 years ago

window.confirm isn't shown

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: evyatar, Assigned: crdlc)

References

Details

(Keywords: regression)

Attachments

(1 file)

When on the homescreen, calling window.confirm (or just 'confirm') doesn't show the UI, but returns false immediately.

I checked this:
console.log('Before confirm');
var ret = confirm('Test confirm'); // nothing is shown
console.log('After confirm: ' + ret); // ret is 'false'

confirm is used by e.me when asking a user to save an app to their homescreen.
Assignee: crdlc → nobody
Does delete image in gallery app work for you? It's using confirm also.
jajaj yep, confirm is working there!
Yes, that works. I also checked from a browser and it works, but on the homescreen itself is doesn't work.
UITest->Alert/Confirm->Confirm WFM.

I need to know what's the UI step to trigger 
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/js/Brain.js#L688
to see what happens.
Search something on search bar and press and hold any icon displayed as result, right Evyatar?
The parameter is ok as well "Add Real Madrid C.F Official to Home Screen?" in my example but the confirm is not displayed
Could be something related to z-index?
Cristian, it's not a style bug because a "false" value returns from it immediately without waiting for user input.
Yes, STR on comment 5 are correct.
This is true ;)

(In reply to Ran Ben Aharon (Everything.me) from comment #8)
> Cristian, it's not a style bug because a "false" value returns from it
> immediately without waiting for user input.
I was adding some log to ModalDialog and I can see that the frameType is undefined

https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/modal_dialog.js#L87

Am I ok?
Component: Gaia::Homescreen → Gaia::System
Flags: needinfo?(alive)
Keywords: regression
This is only a workaround to continue working on bug 910351

diff --git a/apps/system/js/homescreen_window.js b/apps/system/js/homescreen_window.js
index f03b025..eb615c6 100644
--- a/apps/system/js/homescreen_window.js
+++ b/apps/system/js/homescreen_window.js
@@ -35,6 +35,8 @@
     // into appWindow.
     this.frame = this.element;
     this.iframe = this.browser.element;
+    this.iframe.dataset.frameType = 'window';
+    this.iframe.dataset.frameOrigin = 'homescreen';
 
     this.element.appendChild(this.browser.element);
Yes, please send me a pull request. Thanks!
Flags: needinfo?(alive)
Attached file Patch v1
Attachment #810992 - Flags: review?(alive)
Comment on attachment 810992 [details]
Patch v1

Ya, This reminds me I need to remove all dataset check later.. thanks!
Attachment #810992 - Flags: review?(alive) → review+
Assignee: nobody → crdlc
Status: NEW → ASSIGNED
https://github.com/mozilla-b2g/gaia/commit/2943da59b9cf96a55b607ee4dfb626ba6f89ae51
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
this works now, however there is an issue:

STR:
1. Search on e.me
2. Tap and Hold an app // "Add to Home Screen" confirm should show
3. Release the finger

Result:
The app is still clicked.
It looks as though the "touchend" event is still being sent to the app's icon.

Expected:
The app shouldn't get clicked.
The "touchend" event shouldn't be sent to the original element, since there's now an element overlaying everything.
fill other bug with it in system component
you're right, it's not relevant to this! done - bug 921397.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: