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

Safari issue with submitting selected options #122

Closed
acetinick opened this issue Jun 7, 2021 · 7 comments
Closed

Safari issue with submitting selected options #122

acetinick opened this issue Jun 7, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@acetinick
Copy link

acetinick commented Jun 7, 2021

Describe the bug
Using safari we have strange issue with selects that have preselected options. New options are selected and submitted fine however for some reason the options selected when editting are submitted as blank values.

image

More strangely is that the HTML markup looks fine.

image

To Reproduce

  • only with safari
  • use a select with preselected option
  • submit form

Expected behavior

  • request params should contain value of selected input

Additional context

  • safari 14.0.3, perhaps earlier versions too
  • tom-select 1.7.5, but also have tried in prior versions and same
@acetinick acetinick added the bug Something isn't working label Jun 7, 2021
@martinbarilik
Copy link

Possibly connected to #98. Are you using latest 1.7.4 version ?

@oyejorge
Copy link
Member

oyejorge commented Jun 7, 2021

Hmm, I don't know what's going on there. I just tested on safari 14 and it worked fine (single select w/ a pre-selected value). Could it be a problem with the code you're using to serialize the form data before sending it over XHR?

@oyejorge
Copy link
Member

oyejorge commented Jun 9, 2021

P.S. If I could get a jsfiddle or similar that fails for you, I could test it on my safari.

@thomasklemm
Copy link

Seeing the same issue in Safari, will try to create a minimal reproduction for debugging.

  • tom-select 1.7.6
  • Safari 14.1.1

@thomasklemm
Copy link

Been able to reproduce this issue (or a similar looking one), here's a CodeSandbox: https://codesandbox.io/s/5okh7?file=/index.html // https://5okh7.csb.app/

I've recorded a 2min video about the unexpected behaviour in Safari using the CodeSandbox above: https://www.loom.com/share/0f70fd8d2dfe4bedb4d3c96be674bf61

For me the issue that the initially selected input value gets submitted happens when the select is marked as required. The select tag in @acetinick's example is also marked required, so maybe the issue is specific to selects marked as required.

@oyejorge
Copy link
Member

Thanks so much for the CodeSandbox example! I can see the problem now, there are multiple <option> nodes with "selected".

Screenshot 2021-07-09 at 19-26-14 Dashboard

@oyejorge
Copy link
Member

Should be fixed now. I'll get a new release out shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants