SpeedDial cant work in web platform,cuz ``` [...new Array(React.Children.count(children))]``` will returned ```[empty × 2]```

Open
#3,879 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react-native, typescript
Domain
frontend

Research direction

Start by reproducing the issue with the provided SpeedDial example on the web playground, then locate the SpeedDial implementation and the React.Children-based child handling mentioned in the report. Done means the web SpeedDial renders its actions and the mask can be closed without changing the existing usage.

Written by the indexing model from the issue text.

Description

Needs Triage
Is there an existing issue for this?
  • I have searched the existing issues
Explain what you did
 import React, {useState} from 'react';
import {SpeedDial} from '@rneui/themed';

export default function HomeScreen() {
  const [open, setOpen] = useState(false);

  return (
    <SpeedDial
      isOpen={open}
      icon={{name: 'edit', color: '#fff'}}
      openIcon={{name: 'close', color: '#fff'}}
      onOpen={() => setOpen(!open)}
      onClose={() => setOpen(!open)}>
      <SpeedDial.Action
        icon={{name: 'add', color: '#fff'}}
        title="Add"
        onPress={() => console.log('Add Something')}
      />
      <SpeedDial.Action
        icon={{name: 'delete', color: '#fff'}}
        title="Delete"
        onPress={() => console.log('Delete Something')}
      />
    </SpeedDial>
  );
}
Expected behavior

rendering component SpeedDial

Describe the bug

Mask and SpeedDial Always showing,Button can not close Mask
website playground also like this
So I find Code Bug

WX20240118-173518@2x
reactnativeelements_speedDial

Steps To Reproduce
use my code can reproduce
Screenshots

No response

Your Environment
`npx @rneui/envinfo`
  ```
    Output from `npx @rneui/envinfo` goes here.
  ```
Dominant language
MDX
Stars
25.9k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-native-elements/react-native-elements

All issues in react-native-elements/react-native-elements

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.