-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Placeholder doesn't appear when content is deleted #171
Comments
Example mobiledoc from the demo before/after deleting all content: {
"version": "0.2.0",
"sections": [
[],
[]
]
} after {
"version": "0.2.0",
"sections": [
[],
[
[
1,
"p",
[]
]
]
]
} So looks like the section has an empty item, should this be deleted returning it to the original when you clear content? |
@rlivsey Good question. Some of the code surrounding the It may make the most sense to preserve the implementation of What do you think? |
@bantic yep that makes complete sense, I'll see if I can figure out how to make it do that… |
it is probably a little wonky, and will take some work on the renderer. I'd be happy to take a look next week. |
This causes the placeholder to appear even when the editor div is not wholly devoid of elements. Possible BREAKING CHANGE: The placeholder text is now absolutely positioned (at `top: 0`) of the editor div. If a user has applied their own padding to the editor div the placeholder may not show up in the correct location. The solution is to add a CSS rule that overrides the `top` to match the value of the `padding-top`: ``` .__mobiledoc-editor.__has-no-content:after { top: <value of padding-top>; } ``` Also: The editor now has a `min-height: 1em;` to ensure that the placeholder has a space in which to be displayed. Fixes #407 #171
This causes the placeholder to appear even when the editor div is not wholly devoid of elements. Possible BREAKING CHANGE: The placeholder text is now absolutely positioned (at `top: 0`) of the editor div. If a user has applied their own padding to the editor div the placeholder may not show up in the correct location. The solution is to add a CSS rule that overrides the `top` to match the value of the `padding-top`: ``` .__mobiledoc-editor.__has-no-content:after { top: <value of padding-top>; } ``` Also: The editor now has a `min-height: 1em;` to ensure that the placeholder has a space in which to be displayed. Fixes #407 #171
This causes the placeholder to appear even when the editor div is not wholly devoid of elements. Possible BREAKING CHANGE: The placeholder text is now absolutely positioned (at `top: 0`) of the editor div. If a user has applied their own padding to the editor div the placeholder may not show up in the correct location. The solution is to add a CSS rule that overrides the `top` to match the value of the `padding-top`: ``` .__mobiledoc-editor.__has-no-content:after { top: <value of padding-top>; } ``` Also: The editor now has a `min-height: 1em;` to ensure that the placeholder has a space in which to be displayed. Fixes #407 #171
…older text (#461) This causes the placeholder to appear even when the editor div is not wholly devoid of elements. Possible BREAKING CHANGE: The placeholder text is now absolutely positioned (at `top: 0`) of the editor div. If a user has applied their own padding to the editor div the placeholder may not show up in the correct location. The solution is to add a CSS rule that overrides the `top` to match the value of the `padding-top`: ``` .__mobiledoc-editor.__has-no-content:after { top: <value of padding-top>; } ``` Also: The editor now has a `min-height: 1em;` to ensure that the placeholder has a space in which to be displayed. Fixes #407 #171
closed by #461 |
Post#isBlank returns false if you type something and then delete all the content resulting in the placeholder text not re-appearing.
The current implementation checks that there are no sections, but I'm guessing at this point there's one blank section.
Should this change to be blank if there are no sections OR one blank section?
Post#isBlank looks to be used internally in a few places, so not sure if that would break those.
Alternatively, there could be a public Editor#isBlank which is to be used instead & change the placeholder behaviour to use this?
The text was updated successfully, but these errors were encountered: