Closed Bug 680371 Opened 13 years ago Closed 12 years ago

Source Editor should implement placeholderText differently

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: cedricv, Assigned: msucan)

References

Details

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

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.
Priority: -- → P3
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.
(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!
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]
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
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!
Whiteboard: [sourceeditor] → [sourceeditor][good-first-bugs][mentor=msucan]
Bug 707987 landed and placeholderText is no more, confusion cleared, bug fixed. Thanks for the report Cedric!
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.