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

Not working with Dialog on IOS #22

Open
andreramoslj opened this issue Jul 4, 2022 · 0 comments
Open

Not working with Dialog on IOS #22

andreramoslj opened this issue Jul 4, 2022 · 0 comments

Comments

@andreramoslj
Copy link

Hi,

Have anyone already implement it on a DIalog?

In my case, i put the component on a Dialog and works on Android just fine, but in IOS it does not appear

Here's my component:

`import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { View } from 'react-native';
import Dialog from 'react-native-dialog';
import { ScrollPicker } from 'react-native-wheel-scrollview-picker';
import { IOption } from '../SelectOneMenu';
import { SelectedText, UnselectedText } from './styles';

('react-native-date-time-scroll-picker');

export interface ScheduleDialogProps {
scheduleDialogVisible: boolean;
handleCancelDialog: Function;
}

const ScheduleDialogComponent: React.FC = ({
scheduleDialogVisible,
handleCancelDialog,
}) => {
const { t, i18n } = useTranslation();
const [selectOptions, setSelectOptions] = useState<Array>([]);
const [selectedItem, setSelectedItem] = useState();

useEffect(() => {
setSelectOptions(['teste1', 'teste2', 'teste3']);
}, []);

return (

<Dialog.Container visible={scheduleDialogVisible}>
<Dialog.Title
style={{
textAlign: 'center',
}}
>
{t('SCHEDULE_POSTS.TITLE')}
</Dialog.Title>

    <ScrollPicker
      dataSource={selectOptions}
      selectedIndex={
        selectedItem == null ? 0 : selectOptions.indexOf(selectedItem)
      }
      renderItem={(data, index, selectedIndex) => {
        if (selectedIndex) {
          setSelectedItem(data);
          return <SelectedText>{data} </SelectedText>;
        }
        return <UnselectedText>{data} </UnselectedText>;
      }}
      onValueChange={(data, selectedIndex) => {
        <UnselectedText>{data} </UnselectedText>;
      }}
      wrapperHeight={180}
      wrapperWidth={10}
      itemHeight={60}
      highlightColor="#FFFFFF"
      wrapperColor="#FFFFFF"
      highlightBorderWidth={2}
    />
    <Dialog.Button
      style={{
        fontSize: 14,
        fontFamily: 'Fire-Sans',
        fontStyle: 'normal',
        lineHeight: 17,
        color: '#80808F',
        marginRight: 16,
      }}
      label={t('GENERAL.BUTTON.CANCEL')}
      onPress={() => handleCancelDialog()}
    />
  </Dialog.Container>
</View>

);
};

export default ScheduleDialogComponent;
`

anyone can help?

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

1 participant