Skip to content

Dropdown select options don't change on click on Firefox #336

@razvanudream

Description

@razvanudream

Describe the bug
product-summary-sku-selector is the problem, to be more precise

` const handleClick = (_: React.MouseEvent, value: string) => {
const reducedOptions = displayOptions.reduce<Record<string, DisplayOption>>(
(acc, cur) => {
acc[cur.label] = cur

    return acc
  },
  {}
)

return reducedOptions[value].onSelectItem()

}`

The value is empty string when selected from Firefox which results in an error

Uncaught TypeError: reducedOptions[value] is undefined handleClick SelectVariationMode.tsx:63

You won't see it like this in production, but here you go from a workspace where I linked to last store-components version

https://skuselector--dacris.myvtex.com/

image

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.dacris.net/ on home page and try to select a value from the drop down (in a shelf)
  2. See error in browser

Expected behavior
The error shouldn't happen and the value should change on click

Screenshots
See above

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.3 LTS
  • Browser Firefox
  • Version 91.0.2 (64-bit) Mozilla For Ubuntu (but tried it on Windows as well with a different version)

Additional context
Tried on several other production sites done on VTEX, same issue. Tried to find a solution but couldn't -> it only happens in Firefox AFAIK. Also it only happens with this block, not sku-selector, that one with the select option works fine.

I also tried installing an older version of store-components, no luck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions