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

url mask placeholder option #93

Open
monecchi opened this issue Sep 9, 2024 · 4 comments
Open

url mask placeholder option #93

monecchi opened this issue Sep 9, 2024 · 4 comments

Comments

@monecchi
Copy link

monecchi commented Sep 9, 2024

How do I change the placeholder for the url mask?

I'm using Next.js 14 with along 'react-hook-form'

The following does not seem to work:

{...registerWithMask('website', 'url', { 'placeholder': 'https://' })}

I want to change the placeholder for the url mask placeholder from http:// to https...

I've gave the code a look here, and it seems to be set to https by default, but my placeholder is http as also the input masked value: http://mywebsite.com

@monecchi monecchi changed the title url input mask prefix url mask placeholder option Sep 9, 2024
@eduardoborges
Copy link
Owner

hey @monecchi how u doing?

well, the url alias treat http and https so you cant set an placehold who trait the mask contract.

in this case its better use an custom mask.

i belive the follow mask will work:

"https:/\/(a|9|.|/|?|=){1,}"

@monecchi
Copy link
Author

@eduardoborges Thanks! I'll give it a try!

@eduardoborges
Copy link
Owner

Hey @monecchi, results? haha

@monecchi
Copy link
Author

monecchi commented Oct 31, 2024

@eduardoborges Thanks for following up. It worked somehow… Although the regex did the trick, the masked result is only readable (visible) after submitting the form, it has a sort of “glitch” and it does not allow typing the (.) dot also. I’ll keep an eye on that in order to see if I’m applying it the right way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants