Closed Bug 1092441 Opened 10 years ago Closed 9 years ago

Calendar should follow text selection pattern.

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(feature-b2g:2.2+, ux-b2g:2.2)

RESOLVED FIXED
2.2 S1 (5dec)
feature-b2g 2.2+
ux-b2g 2.2

People

(Reporter: swilkes, Unassigned)

References

Details

Attachments

(2 files)

See Productivity pages of attached spec. All event text should be selectable.

Pattern guidelines:
* Input fields (input areas, input dialogs and search fields) are the only Building Blocks with selectable text. 

* HTML elements like buttons or links, or events like ontouchstart or onclick, should trigger the action when tapped rather than triggering text selection.
Blocks: gaia-copy-paste
No longer blocks: CopyPasteLegacy
feature-b2g: --- → 2.2?
The Gecko work is close to completion, the remaining part is to fix test case failures then pref it on in m-c bug 1092888. After the bug landed, text selection and cut/copy/paste can be triggered in apps on both editable and non-editable elements.

Gaia per app work in v2.2 is to follow UX guideline and leverage CSS -moz-user-select https://developer.mozilla.org/en-US/docs/Web/CSS/user-select to make certain elements non-selectable.

Before Gecko is pref on in m-c, Gaia can manually switch it on by the following two pref to test in advance:
pref("selectioncaret.enabled", on);
pref("selectioncaret.noneditable", on);
I'm hoping we can solve it with just `body { -moz-user-select: none; }` and `#modify-event-view { -moz-user-select: text; }` just not sure if setting the `-moz-user-select` on the `<body>` will have any performance impact. Are there any "best practices" that we should follow?
Depends on: 1097419
This is a 2.2 feature.
feature-b2g: 2.2? → 2.2+
QA Whiteboard: [2.2-feature-qa+]
QA Whiteboard: [2.2-feature-qa+] → [2.2-feature-qa+] [textselection]
hi James, since you did this work for Email and Gareth is away, can you review it for me? thanks!
Attachment #8530393 - Flags: review?(jrburke)
Status: NEW → ASSIGNED
This looks good to me, but I am having trouble testing the -moz-user-select: all for the event-view. Actually, testing at all, as it seems like long presses in calendar ends up with a crash of calendar.

It could be that I just have a bad flash? But I tried before this changeset on a pvt image flash dated a couple of days ago and had a similar problem. Then tried with latest pvt image flash with this changeset and it crashes. 

So not a problem with this specific changeset, either a platform/flashing thing or some other calendar code interference.

The long press crash does not happen in the email app though, so another data point. I did not see any obvious contextmenu or long tap thing in calendar that might be causing interference, so not sure what is going on yet. Maybe a z-index thing, hidden layer thing? Just wildly speculating.

STR:

* Open calendar, tap on event to go to event-view
* Long tap hold on the title of the event-view.

Nothing useful in the adb logcat, just that a Crash Reporter crash is reported.

If you are not seeing that, then perhaps just a temporary issue. I thought at first it was the #event-view ul `-moz-user-select: all` style, as that is not something we used in email, but changing it to 'text' did not help the crash. Neither did removing the full style on the ul. Plus, I was able to get a crash in calendar before this change.

---

One review question: on the use of `-moz-user-select: all`: I am curious if that means it copies the HTML tags too. If you paste that into an email compose body area, does it get some ul or li styling if the selection spans multiple elements, or just a text copy?

That is the last thing I want to sort out with the review.
Comment on attachment 8530393 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/26560

Confirmed in person on the -moz-user-select: all behavior, thanks :millermedeiros!
Attachment #8530393 - Flags: review?(jrburke) → review+
it doesn't crash to me on:

Gaia-Rev        824a61cccec4c69be9a86ad5cb629a1f61fa142f
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/acde07cb4e4d
Build-ID        20141125040209
Version         36.0a1
Device-Name     flame

the `-moz-user-select: all` is to select the whole content at once instead of selecting just the text from the hit target element. I did that since we have multiple elements that holds the data (required less CSS selectors and faster to select the whole thing)
landed on master: https://github.com/mozilla-b2g/gaia/commit/c70a4fe684d24243db2ad35becaf88368344ad9c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S1 (5dec)
QA Whiteboard: [2.2-feature-qa+] [textselection] → [2.2-feature-qa+] [COM=Text Selection]
You need to log in before you can comment on or make changes to this bug.