| Summary: | Alert in new HelloWorld sample needs fixing | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | broy2 | ||||||||
| Component: | EDT | Assignee: | Xiao Bin Chen <xiaobinc> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P1 | CC: | smythew | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 207100 [details]
EDT
Please try to fix this by Monday, as it is very visible to users. This bug is not specific to the Hello World example. It will occur anytime the message being displayed in a Dojo Dialog is shorter than the title text. Agree this needs to get fixed. I would think the Dojo dialog widget would account for this and increase the width of the dialog such that the title wouldn't get cut off. I would check the Dojo docs and see what it recommends. Fixed. Verified in 20111118. I'm on the 20111121 build. Type abc for the name and click Go. The title overlaps the close icon. It seems to depend on the name entered. When I enter brenda, the title is OK. fixed, adding the length of 'x' image consideration. Tested below input: a ab abc abcd abcde abcdef abcdefg And it works correctly, if it does not works in your machine,please reopen it. Verified in 20111122 build. The current fix/implementation is not going to hold up in the scenario where the developer supplies a long (based on character length) message string, but the string (when rendered in the dialog) is not wider than the title. For example:
DojoDialogLib.showMessage("States", "AZ<br>CO<br>NM<br>VT", null);
This again causes the title to overrun the close X since the title string ("States") is shorter - based on string length - than the message string.
One logical solution is to avoid trying to compare the title and message string lengths when determining the width, since string length does not equate to the width of the string on the dialog. CSS has a "min-width" attribute that allows the browser to make a better decisions on the width of the dialog (in contrast to setting).
I replaced the current logic with the following line:
dialog.style = "min-width: " + title.length() + "em";
Note the dialog's minimum width is determined by the title's length (and only the title's length).
Here is an example where the current solution fails:
DojoDialogLib.showMessage("States", "AZ<br>CO<br>NM<br>VT", null);
Created attachment 207455 [details]
Patch for this defect
(In reply to comment #12) > Created attachment 207455 [details] > Patch for this defect Test below case: Title: "t" a <br>a ab abc "States' a ab abc abcd abcde AZ<br>CO<br>NM<br>VT a<br> a<br>a<br> Resolved. Verified in 20111129 build. |
Created attachment 207099 [details] RBD The title in the alert of the HelloWorld sample overlaps the close icon. The title in the alert when run in RBD is Alert and doesn't overlap the close icon. The title when run in EDT is HelloWorldView and overlaps the close icon. Screen shots of RBD and EDT attached.