-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Cannot 'unfloat' field labels #688
Comments
Maybe I need to understand the floating label mechanism a bit more, and maybe this should be partly a feature request instead. The bug is still there for sure, but I think I'm looking for a different bit of behavior. When I turn off the floating (where it removes the '.floating' css class), it removes the placeholder, and adds the floating style back when the field is focused; thus causing issues with my layout when tabbing/clicking into textboxes. What would be best for me is some class (or lack of a class) when there is/isn't a element added. CSS doesn't support parent selectors, and the |
Or maybe we redo the css so that the css class is on the label element itself instead of the parent.. 🤔 |
The solution I had to go with was just to add a marker css class to the field and avoid the nonfloating altogether. Made it a bit simpler |
Describe the bug
![image](https://user-images.githubusercontent.com/861908/183741377-92a29682-7d08-4544-b222-92c599e2fc39.png)
I have a theme that needs the field labels to always float. Looks like this:
So, in an entryPoint, I configure this default behavior with this:
However, there are times that I need certain fields to not float labels (for any input that may not have a label). When I try to create with
.nonfloating()
orsetFloating(false)
it doesn't do anything (thefloating
css class stays on the element).Looking at the code, I believe I have found the issue. When
.setFloating(true)
is called, it sets the boolean fieldpermaFloating
to true. And with my setup, the constructor will set this to true due to the DominoUIConfig.In
nonfloating()
, it first callsunfloatLabel()
which checks thepermaFloating
value; and since it's true, it'll just return without removing the 'floating' css style. However, thenonfloating()
next line isthis.permaFloating = false
, which means in order to turn off floating, i have to call.nonfloating()
twice. The following code is the work aroundThe text was updated successfully, but these errors were encountered: