-
Notifications
You must be signed in to change notification settings - Fork 6
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
Change how show() and hide() work #4
Comments
Show full context of your code. Metro version? You use jQuery? |
Sorry for the lack of details. The metro version of the npm-package is The setup to reproduce is pretty easy. HTML: <div>
<input type='text' data-role='input' />
</div> JS: $('input').show().hide(); |
And my current fix is to use this snippet to show and hide the objects: public static hide(object: any) {
object.addClass('d-none');
}
public static show(object: any) {
object.removeClass('d-none');
} |
|
Input component is comlex element. After add role input to element, metro add wrapper and additional elements. To hide component, you must hide wrapper. |
If method show can get display value from element, then uses it. You can add specific display value before using show/hide to use this value. |
Ok thank you. |
When doing this on an input element:
the styling of the input gets destroyed.
This is because the show method adds the
display: block
css property. But this changes the behavior of an inline-element for example and because of this cannot be used always.Can you instead add and remove a hide-class (I am currently fixing it using
.addClass('d-none')
) or just remove the css-display-styling?The text was updated successfully, but these errors were encountered: