Giter VIP home page Giter VIP logo

react-native-material-dialog's Introduction

Hi there! ๐Ÿค“

react-native-material-dialog's People

Contributors

hectahertz avatar iroachie avatar rishitkedia avatar sasurau4 avatar timwangdev avatar vonovak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-material-dialog's Issues

Typescript typings

Hey man! Great library. Just wondering if you're interesting in having typescript definitions for this library (for those wanting to use react native with typescript). I already have stubbed them out in a few of my projects. Let me know @hectahertz

Bug - undefined is not object (evaluating 'result.selectitem.value')

@hectahertz :
Hi, I'm using "SinglePickerMaterialDialog",
I realized, if by mistake the user does not press any of the proposed options and then presses on "OK".
The following error is given:
Bug - undefined is not object (evaluating 'result.selectitem.value')

It would be possible to consider the case in which the user does not press anything and press ok.
So not from this mistake.

Custom styles

I was wondering if you were interested in adding customizable styles, should be fairly easy pr, the default elevation of 24 leaves an absurdly huge shadow around the modal for my taste.

Warning: CheckPropTypes when using this library

It display when I add SinglePickerMaterialDialog and MaterialDialog in component.

This is my code:

<SinglePickerMaterialDialog
                        title={'Category'}
                        items={CATEGORIES.map((row, index) => ({ value: index, label: row }))}
                        visible={this.state.visibleCategory}
                        selectedItem={this.state.selectedItem}
                        onCancel={() => this.setState({ visibleCategory: false })}
                        onOk={(result) => {
                            this.setState({
                                selectedItem: result.selectedItem,
                                category: result.selectedItem.label,
                                visibleCategory: false
                            });
                            AsyncStorage.setItem('Category', '' + result.selectedItem.value);
                            this.props.changeSetting(result.selectedItem.value);
                        }} />

If I comment it, this warning disappear.

ScrollView inside MaterialDialog doesn't scroll

Code snippet:

<MaterialDialog
	visible={this.state.isVisible}
	okLabel={'OK'}
	onOk={this.closeModal}
	onCancel={this.closeModal}
	scrolled={true}
>
	<ScrollView>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
		<Text style={{padding: 100}}>Lorem ipsum ....</Text>
	</ScrollView>
</MaterialDialog>

The View containing the children should set onStartShouldSetResponder , as detailed in this SO:
https://stackoverflow.com/questions/33060859/react-native-touchable-is-disabling-scrollview

Tested the fix and it works well. I'll submit a PR.

Alert dialog with image, title and description

Hi @hectahertz

Is there a way thatI can put the title below the image, currently when I create a custom content for the dialog box the title appears on top of the dialog

screen shot 2018-01-07 at 11 55 35 pm

If I put a description text below the title this is what I'm getting:
screen shot 2018-01-08 at 12 31 59 am

Is there a way how can I do this?

screen shot 2018-01-07 at 11 54 26 pm

Also te alert dialog seems have a fix height, because if I have a long text content its like getting an overflow: hidden

Failed prop type: The prop `children` is marked as required in `MaterialDialog`, but its value is `undefined` in MaterialDialog

Hi I am facing problem when using function with return to show Material dialog for loading dynamic values.
This is my code
Please help me I am new in RN

showMaterialDialog(key) {
        this.state.data.filter(obj => {
            return obj.key === key;
        }).map((obj, idx) => {
            return (
                <MaterialDialog
                    title="Use Google's Location Service?"
                    visible={true}
                    onOk={() => this.setState({ visible: false })}
                    onCancel={() => this.setState({ visible: false })}>
                </MaterialDialog>
            )
        })

    }

I am calling this function onPress of Text

Footer cut off on SinglePickerMaterialDialog

Hey this package is awesome! Thanks for the hard work.

I ran into an issue when the scrolled attribute is added to SinglePickerMaterialDialog, and there are enough items to scroll, then the footer is slightly cut off. I can't imagine this is every device, but I tested both on the Galaxy 6S and the Nexus 5X.

OK - Not Enough Items to Scroll Bug - Enough Items to Scroll
OK - Not Enough Items to Scroll Bug - Enough Items to Scroll

Please let me know if I can provide more details. Thanks again.

Edit: I was also able to reproduce on both devices with the code provided in the example.
Edit: Does work on iOS.

[MaterialDialog] Padding

Hey! ๐Ÿ‘‹

This is great! Thank you for working on this. ๐Ÿ™

I have a use-case where I'd like to control the padding of MaterialDialog and set it to 0.

Negative margins work on iOS, but on Android, I'm not able to get past paddingTop set here: ๐Ÿ˜ญ

Possible Solutions

  1. Adding a modalContainerStyle prop, and merging it with the styles.modalContainer View.

  2. Instead of setting paddingTop in styles.modalContainer, setting it in styles.contentContainer, but then we'll have to set it in all the styles.containers individually.

Any thoughts on this? Thanks for your time! ๐Ÿ˜ƒ

select all button in MultiPicker

hi. i think it will be awesome to put "Select All" option in MultiPickerMaterialDialog. Right now its not there.
I was asked by different clients to must put this option so kindly help in this regard.

thanks

Buttons aren't displayed

with onOk and onCancel defined the buttons in dialog aren't displaying.

Content and Title are displaying correctly.

                    < SinglePickerMaterialDialog
                        title={this.props.translate("TEMPLATE.TITLE")}
                        items={this.props.options.map((row, index) => ({value: index, label: row.cost}))}
                        visible={this.state.singlePickerVisible}
                        selectedItem={this.state.selectedTraining}
                        colorAccent={Colors.colors.ui.primaryDark}
                        backgroundColor={Colors.colors.ui.primary}
                        onCancel={() => this.setState({singlePickerVisible: false})}
                        onOk={(result) => {
                            this._select(result)
                        }}
                        />

![image](https://user-images.githubusercontent.com/143454/38277289-e7ddc926-3765-11e8-92b9-7145a02d3148.png)

Bug on not selectedIndex press ok

If no item is selected, then press the ok key, the app restarts every time.
One possible solution could be that in:

   OnOk = {() => this.props.onOk ({
           SelectedItem: this
           .state
           .Rows [this.state.selectedIndex]
         })}

You must check the value of this.state.selectedIndex
guy:

  onOk={() =>
if(this.state.selectedIndex ) != undefined) 
 this.props.onOk({
          selectedItem: this
          .state
          .rows[this.state.selectedIndex],
        }))}

He could not try it again.

SinglePickerMaterialDialog | Selected item not getting saved

After selecting an Item in SinglePickerMaterialDialog and pressing "OK" the dialog box disappears. If we open the SinglePickerMaterialDialog again, it shows the first item selected by default instead of last selected item.

Tried changing the same through state as well but it's not working.

In below example, we have passed hardcoded object as "selectedItem". Still it is picking up
the 1st object (with key=0) as default selected item.

SinglePickerMaterialDialog
colorAccent = '#FD8000'
title = {
'Choose Filter Option'
}
scrolled
items = {
[{
key: 0,
label: 'Assigned to me123'
},
{
key: 1,
label: 'Priority'
},
{
key: 2,
label: 'Unassigned'
},
{
key: 3,
label: 'Everything'
},
]
}
visible = {
this.state.scrolledSinglePickerVisible
}
selectedItem = {
{
key: 3,
label: 'Everything'
}
}

onCancel = {
() => this.setState({
scrolledSinglePickerVisible: false
})
}
onOk = {
result => {
this.setState({
scrolledSinglePickerVisible: false
}, () => {});
}
}
/>

[iOS] Picker lablel's character is displaced when using combination of single and double byte characters

Summery

When using combination single and double byte character sentence as Picker dialog label, double byte characters are shifted up a little compared to single byte character in iOS.
On Android work fine and perfect!

Reporoduce example

Exmample snack is here

In snack, this year is 2017 is correctly displayed.
The other hand ไปŠๅนดใฏ2018ๅนดใงใ™ and ์˜ฌํ•ด๋Š” 2016 ๋…„์ž…๋‹ˆ๋‹ค are displaced.
Double-byte characters ไปŠๅนดใฏ are shifted up a little compared to single-byte characters 2018.

Is there a solution to fix it?

P.S.
react-native-material-dialog is awesome and very useful! Thanks! ๐Ÿ‘

Can't save selected items after press Ok in MultiPickerMaterialDialog

I define state={ seleted:false,selectitems:[] }
<MultiPickerMaterialDialog title={'้ธๆ“‡่ฆ้กฏ็คบ็š„ๆ•ธๆ“š'} titleColor={'#555555'} items={LIST.map((row, index) => { return {value: index, label: row} })} visible={this.state.select} selectedItems={this.state.selectitems} okLabel={'็ขบๅฎš'} scrolled={true} cancelLabel={'ๅ–ๆถˆ'} onCancel={() => this.setState({ select: false })} onOk={(result) => { this.setState({ select: false }); this.setState({ selectitems: result.selectedItems }); console.log(this.state.selectitems) }}/>
,and const array LIST
just the same as the example doc
But selectitems are still empty after I press OK button
Is there anything wrong?? Hope someone could help me,thanks :'((

iPhone SE Cancel/ OK buttons not appearing

simulator screen shot - iphone se - 2018-04-15 at 10 51 56

Hi, attached is the screenshot of the Cancel/ OK buttons not appearing on the iPhone SE. However, it appears on the iPhones with bigger screen sizes.

My code is:
<MultiPickerMaterialDialog
title={"Select days"}
colorAccent={GLOBAL.COLOR.BUTTON_ICON}
items={LIST.map((row, index) => {
return { value: index, label: row };
})}
visible={this.state.multiPickerVisible}
selectedItems={this.state.multiPickerSelectedItems}
onCancel={() => this.setState({ multiPickerVisible: false })}
onOk={result => {
this.setState({ multiPickerVisible: false });
this.setState({ multiPickerSelectedItems: result.selectedItems });
}} />

Am I missing something here? Please assist.

Compatibility with React Native 0.44.0?

Having trouble using this module with RN-0.44.0.

To Reproduce:

updated examples/package.json modules to:

"react": "^16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-vector-icons": "^4.1.1"

rm -rf node_modules && npm install
react-native run-android

Error:

error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactPropTypes`

onOk and onCancel

Please provide onOk and onCancel as optional and developer will select any one of them. Because sometimes we need an option to close dialog when user clicks only OK button

Long labels are not wrapped correctly

Hi,

there seems to be a bug in the SinglePickerMaterialDialog component (scroll-mode): it does not wrap long items correctly.
Please see this screenshot:
wrap

Avoid Keyboard?

Is there anyway to move the entire modal upwards when the keyboard opens?

For example I have a text input in the dialog, when the keyboard opens the dialog actions get covered.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.