Source Editor should implement placeholderText differently

RESOLVED FIXED

Status

()

Firefox
Developer Tools
P3
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cedricv, Assigned: msucan)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sourceeditor][good-first-bugs][mentor=msucan])

(Reporter)

Description

6 years ago
Source Editor currently implement placeholderText option like an initialText option rather than the expected placeholder behavior, which is to make the text disappear as soon TextChanged and the editor is not empty (and come back if editor is emptied again).

Perhaps it is not necessary to expose current behavior as a new initialText option since it's as easy (and more flexible) to just use editor.setText(initialText) when editor is ready.

Updated

6 years ago
Priority: -- → P3
(Reporter)

Comment 1

6 years ago
About setText(initialText), it's worthy to note that there seems to be currently no way to programatically set the text without impacting the undo stack.
(Assignee)

Comment 2

6 years ago
(In reply to Cedric Vivier [cedricv] from comment #1)
> About setText(initialText), it's worthy to note that there seems to be
> currently no way to programatically set the text without impacting the undo
> stack.

That would be a nice new feature to the SourceEditor API. Please open a new bug, since it is a different request. Thanks!
(Assignee)

Comment 3

6 years ago
This is a nice-to-have change for the Source Editor. Not sure it's a minotaur bug. (feel free to disagree!)
Whiteboard: [minotaur] → [sourceeditor]
(Assignee)

Comment 4

6 years ago
This is going to be fixed by bug 707987 which makes changes to the SourceEditor options.
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Depends on: 707987
Version: unspecified → Trunk
(Assignee)

Comment 5

6 years ago
For people following this bug: the patch from bug 707987 renames the Source Editor initialization option "placeholderText" to "initialText" to clear confusion. A placeholder option like in a typical textarea/input does not make much sense in a code editor - if you think it does, please open a new bug as this one will be closed when bug 707987 lands. Thank you!
(Reporter)

Updated

6 years ago
Whiteboard: [sourceeditor] → [sourceeditor][good-first-bugs][mentor=msucan]
(Assignee)

Comment 6

6 years ago
Bug 707987 landed and placeholderText is no more, confusion cleared, bug fixed. Thanks for the report Cedric!
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.