react-native-modalbox icon indicating copy to clipboard operation
react-native-modalbox copied to clipboard

Is it possible to change the size of modal after it is rendered ?

Open jitinmaher opened this issue 7 years ago • 5 comments

I want to increase the height of modal when modal content is scrolled upwards and decrease it when scrolled downwards.

I am changing the height but nothing seems to work. I wonder if it is possible or not ?

jitinmaher avatar Jul 26 '17 10:07 jitinmaher

you can try providing callback method to model. call this method on scroll of the content in model.

chetankotkar avatar Aug 09 '17 12:08 chetankotkar

I know this is wicked old but for other people googling through, I was having the same issue adjusting the height after the modal was rendered trying to emulate the android bottom sheet with a peek header. I found that PR https://github.com/maxs15/react-native-modalbox/pull/94 was causing issues

Specifically the line that added:

delete this.onViewLayoutCalculated;

I deleted it and now my height changes as expected. I'm not sure what other effects deleting it will have but for me it works.

reasonman avatar Feb 02 '19 04:02 reasonman

@reasonman it worked like a charm, you saved my day man!

toioski avatar Apr 03 '19 12:04 toioski

@reasonman worked like a charm for me also, thanks!

allens01 avatar Jun 03 '20 11:06 allens01

@reasonman thank you so much for this fix. The line being referenced is now this line https://github.com/maxs15/react-native-modalbox/blob/v2.0.0/index.js#L567

@maxs15 Any chance this fix could be brought in?

cameronmurphy avatar Oct 19 '21 01:10 cameronmurphy