Skip to content

Commit 3360204

Browse files
committed
fixed placeholder issue
1 parent c185e03 commit 3360204

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

dist/sceditor.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sceditor.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sceditor.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/SCEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,12 @@ export default function SCEditor(original, userOptions) {
714714

715715
dom.on(wysiwygBody, 'blur', function () {
716716
if (!base.val()) {
717-
dom.addClass(wysiwygBody, 'placeholder');
717+
dom.addClass(wysiwygBody, 'sceditor-placeholder');
718718
}
719719
});
720720

721721
dom.on(wysiwygBody, 'focus', function () {
722-
dom.removeClass(wysiwygBody, 'placeholder');
722+
dom.removeClass(wysiwygBody, 'sceditor-placeholder');
723723
});
724724

725725
dom.on(sourceEditor, 'blur', valueChangedBlur);

src/sceditor.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ div.sceditor-grip {
6767
float: left;
6868
}
6969

70+
body.sceditor-placeholder::before {
71+
content: attr(placeholder);
72+
color: #555;
73+
font-style: italic;
74+
}
75+
7076
.sceditor-color-option {
7177
display:block;
7278
width: 18px;

0 commit comments

Comments
 (0)