haya-select 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haya-select",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -569,12 +569,14 @@ export default memo(shapeComponent(class HayaSelect extends ShapeComponent {
569
569
  const {toggleOptions} = this.props || {}
570
570
  const toggled = this.getToggled()
571
571
  const icon = this.iconForOption(currentValue)
572
+ const toggleValue = toggled[currentValue.value]
573
+ const toggleOption = toggleOptions.find((toggleOptionI) => toggleOptionI.value == toggleValue)
572
574
 
573
575
  return (
574
576
  <div
575
577
  className="haya-select-option-presentation"
576
- data-toggle-icon={toggleOptions && toggled && toggleOptions[toggled[currentValue.value]]?.icon}
577
- data-toggle-value={toggleOptions && toggled && toggleOptions[toggled[currentValue.value]]?.value}
578
+ data-toggle-icon={toggleOption?.icon}
579
+ data-toggle-value={toggleOption?.value}
578
580
  data-value={currentValue.value}
579
581
  >
580
582
  {toggleOptions && !(currentValue.value in toggled) &&