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

HTML required message doesn't show if no value is selected #575

Closed
LordSimal opened this issue Oct 20, 2024 · 20 comments
Closed

HTML required message doesn't show if no value is selected #575

LordSimal opened this issue Oct 20, 2024 · 20 comments

Comments

@LordSimal
Copy link

LordSimal commented Oct 20, 2024

Describe the bug
E.g. the following select inside a form doesn't show any kind of error or notice, that a value needs to be selected:

<select required="required" data-validity-message="My custom required message" oninvalid="this.setCustomValidity(''); if (!this.value) this.setCustomValidity(this.dataset.validityMessage)" oninput="this.setCustomValidity('')">
  <option value selected>Please select something</option>
  <option value="1">Option 1</option>
  <option value="2">Option 2</option>
  <option value="3">Option 3</option>
</select>

Recreate it in Codepen
https://codepen.io/kevinpfeifer/pen/qBeXqgB

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codepen.io/kevinpfeifer/pen/qBeXqgB
  2. Click on Submit
  3. The message "My custom required message" will pop up over the native select but not the slim select one
  4. If you select something in the native select the the submit button won't do anything.
  5. If you select a value inside both selects then the form submit handler will trigger and show an alert to indicate, that the submit worked.
@LordSimal
Copy link
Author

LordSimal commented Oct 20, 2024

The main problem is the fact, that the input gets display: none
and therefore the JS Console outputs:

An invalid form control with name='test1' is not focusable.

@brianvoe
Copy link
Owner

Not a bug. Sounds like a feature. If you would like to submit something please submit a pr with tests and ill take a look at the implementation.

Thanks

@LordSimal
Copy link
Author

So you expect me to get involved in your library and get to understand how you build it to restore a HTML native behavior for inputs since - for you - its not a bug, its a feature?

To be clear, its not about the custom required message, its about having a required select with no value at all showing no error which confuses pretty much everyone using this lib.

Well, good luck then, I look for another lib which at least honors the HTML default behavior.

@brianvoe
Copy link
Owner

Sorry my Lord. I did not expect this to displease the all mighty CakePHP master.

Ill jump on this critical bug post hence. How have so many people not been able to use this package without your wisdom is beyond me.

Sincerely,
Your little cupcake

@brianvoe
Copy link
Owner

Hey look someone submitted a pr! #577

See how easy that is my Lord? The crazy thing is you work in open source.

@LordSimal
Copy link
Author

i never said, that this repo won't receive any PR's from anyone else or that its impossible to submit a PR.

All I stated is the fact, that I have a problem (thats what issues are for just so you know), I described and gave an example on how to reproduce it and you categorized it as a feature and closed the issue.

I would have been totally fine if you just said "weird, sorry I can't fix that right now. Maybe you or another community member can try to fix that via a PR", kept the issue open and I would have been totally fine.

But you seem to not understand, that the one submitting an issue doesn't need to be the one fixing it. You have 46 contributors on this repo, so maybe someone else would have seen my issue and maybe tackled it. But no, Mr. "Its not a bug, its a feature" closes it and says "fix it yourself".

But we can for sure go on with this nonsensical conversation we have here right now over how open source works 👍🏻

@brianvoe
Copy link
Owner

Still not a bug. Just cause something exists on a select element doesnt mean that same thing needs to exist in Slim Select.

I build out things for people all the time. What I dont do is build out things for people like you. People the come in, complain that this packages doesnt do what they want, argues with me, complains they have to get involved if they want there feature in.

You are the reason people hate working on open source projects.

@LordSimal
Copy link
Author

You are the reason people hate working on open source projects.

Achievement unlocked I guess.

So just a random question. If you ever had a problem in the linux kernel, would you learn and fix it yourself as well?

@brianvoe
Copy link
Owner

If the linux kernel didnt have a feature I wanted, I wouldnt submit a bug.

Cause if i submitted a "bug" and said "The linux kernel doesnt do this thing that windows does". They would respond with "This is not a bug. This sounds like a feature."

@LordSimal
Copy link
Author

in the end its clear that you don't see the difference in behavior between a pure HTML select and your overwritten/extended JS selectbox, therefore I wish you all the best - you won't hear from me again since the fun in trying to understand you is gone.

maybe someone in the future will fix this annoying bug for anyone using not nullable fields behind a dropdown.

I'd just expected that a plugin with the description of Single Select and Multi Select in its Readme.md would behave just like a native one, but this seems to be a grave overestimation.

@brianvoe
Copy link
Owner

HAHA super clear. You want required in slim select. To add it would be a new feature. Not a bug.

Btw just checked, no sign of required in Select2 and Choicesjs so i guess we all have bugs.

@LordSimal
Copy link
Author

No idea what you checked but here is a working version of Select2.

https://codepen.io/kevinpfeifer/pen/rNXGXby

2024-10-23_18-53-16 (1)

As you can see both messages for "My custom required message" are being shown.

Here is SlimSelect

2024-10-23_18-55-42 (1)

ChoiseJS unfortunately has the same problem as slimselect.

@brianvoe
Copy link
Owner

Well so much for "you won't hear from me again"

You have spent more time arguing than if you just looked at the code and submitted a pr.

Once again you are the reason people hate working on open source projects. Always negative, never helpful.

Do better. I love you.

@LordSimal
Copy link
Author

Thanks for expecting me being a frontend dev and dealing with this modern JS crazyness, but I don't care about all that TypeScript mumbo jumbo. I just care about HTML native behavior which you clearly don't.

You wouldn't have heard from me if you didn't tell lies about "select2 doesn't have this issue" which you clearly didn't test or even mention as can be seen above.

But again you also don't really care about open source but rather force people to do the work for you because "its not a bug, its a feature".


Thanks for telling me, that "I am the reason people hate working on open source projects". If project maintainers don't understand issues and blame everything on the community then I am sorry, I don't really see that as my problem.

But If I so upset you my dear Open Source God, why not just delete this repo entirely so that you don't have to think about awefull people like me?

@brianvoe
Copy link
Owner

Still complaining and whining. This whole time you have done nothing.

Meantime I have already been helping other people with issues, on multiple MIT projects ive provided. I also already made updates to implement requireds, was going to release it but you decided to come back and keep complaining. You are your own worse enemy. If you would have just come in and said "Hey I use requireds on my select, but see that Slim Select doesnt check for them right now, any chance we can add requireds to Slim Select?" I probably would have written something that night. Have done it many times before. But nope not you.

"force people to do the work for you" - haha ok https://github.com/brianvoe/slim-select/graphs/contributors

Just be a decent human being and you just might get much further in life.

@LordSimal
Copy link
Author

Still complaining and whining. This whole time you have done nothing.

No, I have made you understand my problem 😁

still don't understand why you closed this issue and re-created it yourself but I don't have to understand everything.

anyway I am going to keep doing my stuff and you keep doing yours and the world will still continue being as it is tomorrow and the days after that.

Have a nice evening and I wish you all the best luck with all your future open source endeavours 😉

@brianvoe
Copy link
Owner

Never was a problem. You are the only person who has ever asked for this. This is a you thing only.

@brianvoe
Copy link
Owner

brianvoe/gofakeit#367

Another good example of someone being nice and trying to contribute.

@brianvoe
Copy link
Owner

Also I put out a new open source repo. Still a work in progress. https://github.com/brianvoe/gimmeHTTP

@LordSimal
Copy link
Author

are you trying to teach me something here or what is this you are doing?

Also seems inconsistent that you didnt close that issue, just saying.

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