eduardoborges / use-mask-input

✏️ A react Hook for build elegant input masks. Compatible with React Hook Form
https://npmjs.com/package/use-mask-input
267 stars 13 forks source link

url mask placeholder option #93

Open monecchi opened 1 week ago

monecchi commented 1 week ago

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

eduardoborges commented 3 days ago

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 commented 10 hours ago

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