Skip to content
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

Mask and DatePicker issue with Floating Label Plugin #777

Closed
shoaibsharif opened this issue Jun 19, 2023 · 2 comments
Closed

Mask and DatePicker issue with Floating Label Plugin #777

shoaibsharif opened this issue Jun 19, 2023 · 2 comments
Labels
🐛 bug Verified bug by team 🚀 release-ready Feature or fix is complete and on an upcoming release branch

Comments

@shoaibsharif
Copy link

Reproduction

https://formkit.link/8e1dd443d03b687d09f9b62642318d2d

Describe the bug

When I pre-filled value via ref on Mask or DatePicker Input, it's not showing the value. But when I focus on the inputs it shows the value.

CleanShot 2023-06-19 at 12 15 30
CleanShot 2023-06-19 at 12 13 39

Environment

• OS: [MacOS]
• Browser [Arc, Chrome]
• Version [0.17.x]

@shoaibsharif shoaibsharif added ⛑ Needs triage The issue has not yet been examined by the FormKit team. 🐛 bug-report Bug is reported, but not verified by team labels Jun 19, 2023
@glennlaysonjr
Copy link

glennlaysonjr commented Jun 19, 2023

I am able to reproduce the same bug. What I can see this is an issue with the CSS and not having target to look at on the input if there is a value in FormKit input. Right now the color is being controlled by:

[data-floating-label="true"][data-type="mask"]:not(:focus-within) input,
[data-floating-label="true"][data-type="datepicker"] input {
  transition-duration: 0.2s;
  transition-delay: 0.1s;
  color: transparent; /* causing issue above */
}

Possible simple addition to formkit to fix above issue:

if used the same data-has-value="true" found on the floating label element and adding it to the sibling input (with same functionally as the label true|false) you could then target the input to set the color in CSS to color: inherit;

glennlaysonjr added a commit to glennlaysonjr/formkit that referenced this issue Jun 20, 2023
- added has value attr to input
- added css to show inhert color
@andrew-boyd andrew-boyd added 🐛 bug Verified bug by team 🚀 release-ready Feature or fix is complete and on an upcoming release branch and removed 🐛 bug-report Bug is reported, but not verified by team ⛑ Needs triage The issue has not yet been examined by the FormKit team. labels Jun 29, 2023
@andrew-boyd
Copy link
Member

andrew-boyd commented Jun 30, 2023

This has been fixed in the latest release via the new data-empty prop available on core and pro component outer wrappers. You may need to clear cache: https://formkit.link/cb9c1b3d233e2c36b34061f1c441f334

Screenshot 2023-06-30 at 11 35 44 AM

If you're using pro inputs you'll need to be on 0.112.7 or later to have the data-empty attributes required for styling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Verified bug by team 🚀 release-ready Feature or fix is complete and on an upcoming release branch
Projects
None yet
Development

No branches or pull requests

3 participants