Here is my code.
My problem is, how can I use the card component to fill the first pane of the SplitPane without using h-100 class?
It is because when I use h-100 class for the Card component, it spoils the layout when the users click on the input box on the mobile platform.
I tried to use the "flex-grow-1" class to solve the problem, however, it does not work.
Besides that, I am not sure whether the react-split-pane its own handling method for the orientation change event. If so, please let me know.
Implementation using
flex-grow-1will not work because if you inspect the elements, the parent of theCardcomponent is an additionaldivelement generated by theSplitPaneand is not aflexcontainer.You can still use
h-100but in order to solve the layout issues on "small window.innerHeight" devices (such as the scenario you described like opening the virtual keyboard on a mobile devices), you simply need to make tweaks in your condition statements to assess whether theSplitPaneshould switchsplitprop ofhorizontalorverticalIn my example below you can see that I factor in a "minimum width" for the left pane to consider the
widthof the input field on your StackBlitz example code which is set to182pxas I reviewed.I imagine you can implement the same in logic when the component mounts.