Closed Bug 384826 Opened 17 years ago Closed 16 years ago

week/day view: drag event time, type title, double click: loses title

Categories

(Calendar :: Calendar Frontend, defect)

defect
Not set
minor

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: gekacheka, Assigned: gekacheka)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.4pre) Gecko/20070614 Sunbird/0.5

When user drags to create an event, its title automatically gains focus so the user can type in a title.  After typing the last character of the title, if the user then double clicks the event to edit additional details, the typed title is lost (and no event dialog appears).  

Reproducible: Always

Steps to Reproduce:
1. drag to create event
2. type characters of title (no return)
3. double click event to edit details
Actual Results:  
typed title is lost
no event dialog appears

Expected Results:  
event dialog appears with typed title

Workaround: remember to type return after the title.
Summary: week/day view: type title, then double click loses title → week/day view: drag event time, type title, double click: loses title
Version: unspecified → Sunbird 0.5
Revised expected behavior.
Change: while editing, double click should select word, not open dialog.
It should still not lose data.

Test cases

Kinds of calendar-events to test:
A. Event in month-view or multiweek-view (calendar-month-day-box-item)
B. All-day event in day-view or week-view (calendar-editable-item)
C. Non-all-day event in day-view or week-view (calendar-event-box)

For each kind, expected behavior tests:
1. Unselected event, not editing text: click selects box (calEvent)
2. Selected event, not editing text: click deselects box, selects text.

3. Unselected event, editing text: click positions cursor in text.
4. Unselected event, editing text: dblclick selects word in text.
5. Unselected event, editing text: type; click OUTSIDE box saves text.

6. Unselected event, not editing text: dblclick opens dialog.
7. Selected event, not editing text: dblclick opens dialog.

(Results for Sunbird 0.5rc2:
 test   A       B       C
 1.     ok      ok      ok
 2.     ok      ok      ok
 3.     FAIL:a  FAIL:a  ok
 4.     FAIL:b  FAIL:b  FAIL:c
 5.     ok      ok      ok
 6.     ok      ok      ok
 7.     ok      ok      ok

[FAIL:a] Stops editing instead of positioning cursor
[FAIL:b] Saves text and opens dialog instead of selecting word
[FAIL:c] If text unchanged, opens dialog instead of selecting word
         If text changed, reverts text, leaves stuck wait cursor,
           instead of selecting word.
)
(patch -l -p 1 -i file.patch)

Problem was that during text editing mode, mouse events should not propagate outside the input field.

Patch 
1. (cleanup) removes redundant inputField blur and keypress handlers from calendar-multiday-view#calendar-event-box constructor (they were identical to ones already defined in base calendar-view-core.xml#calendar-editable-item constructor)

2. (clarify) renames the inputField blur and keypress handlers in calendar-editable-item constructor to remove "allday" in their names: they are used in all event boxes, not just all-day ones.

3. (fix) Adds handlers in calendar-editable-item constructor to stop propagation of mouse events if the event title is being edited.


(add review request after 0.5 released)
Assignee: nobody → gekacheka
Status: NEW → ASSIGNED
At the moment I get following error message when performing the STR from comment#0:
Error: document has no properties
Source File: chrome://calendar/content/sun-calendar-event-dialog.js
Line: 194

Is the attached patch still useful?
OS: Windows 2000 → All
Hardware: PC → All
(patch -l -p 1 -i file.patch)

Updated patch.  
Passes tests described in comment 1.  
(Changes are described in comment 2.)
Attachment #268882 - Attachment is obsolete: true
Attachment #295555 - Flags: review?(michael.buettner)
Comment on attachment 295555 [details] [diff] [review]
v2 patch: stop propagation of mouse clicks if editing

Works like a charm, thanks for the patch. r=mickey.
Attachment #295555 - Flags: review?(michael.buettner) → review+
patch checked in on trunk and MOZILLA_1_8_BRANCH

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.8
Version: Sunbird 0.5 → unspecified
Verified with Lightning 2008012900 and Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12pre) Gecko/20080127 Calendar/0.8pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.