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
MousePosition: allow rendering of empty string #12488
MousePosition: allow rendering of empty string #12488
Conversation
The tests make it look like the current behavior is intentional:
|
See #8109 for the PR introducing the current behavior. |
An alternative would be to render an empty element instead of a non-breaking space by default. This would not break applications that are relying on the current documented/tested behavior with respect to |
Thanks for the reminder, @MoonE . After reading through #8109 and #2914, I think this pull request makes sense (maybe a breaking change, but maybe a fix). If you want to clear the control on mouseout, use the default options (same as If you want to retain the position on mouseout, pass If you want to clear the position by rendering an empty element instead of a non-breaking space, pass Kind of subtle and awkward (but I think that is mostly due to the |
@JakobMiksch can you update the tests to cover the new behavior (change existing test for empty string and add test for |
While we are at it, maybe also change the name from |
I had |
I pushed new tests in 9e7f5a9. |
Thanks for the contribution, @JakobMiksch |
@marcjansen - see #12491. The change there restores the previous (awkward) behavior of |
@tschaub thanks for finalizing this PR. I would have tried soon, but you were faster 👍 |
fixes #12482
ol.control.MousePosition
This PR makes it possible to enter an empty string
''
asundefinedHTML
value. This will finally add an empty string into the target HTML element. The behavior before was that an empty string was recognized as falsey and therefore the default value - a whitespace - was used in the target HTML element.