invertase / react-native-material-design

React Native UI Components for Material Design
http://react-native-material-design.github.io
MIT License
3.15k stars 366 forks source link

Ripple elevation property is incompatible cross-platform #146

Open dantman opened 7 years ago

dantman commented 7 years ago

The elevation property for the <Ripple> component in lib/Ripple.js does not work properly cross-platform.

On Android the elevation property is passed to a View. Passing a number works, passing an array causes an Error while updating property 'elevation' of a view managed by: RCTView error.

On iOS the elevation property is passed to the <Ripple> polyfill component in lib/polyfill/Ripple.js. Passing an array of two numbers works, passing a number results in an "Invalid prop elevation of type number supplied to Ripple, expected array" warning and does not work.

dantman commented 7 years ago

Ideally polyfill/Ripple would drop the elevation array, Ripple would instead implement it, Ripple would also accept a number when the elevation doesn't change, and Button and other components would stop re-implementing elevation changes on tap and the cross-platform handling that Ripple does.