I'm trying to animate a button so that if it is clicked, a picture will appear, but when it is clicked again, the picture will disappear- I want this to continue to happen indefinitely- I feel like this can easily be written with a macro, but I want to avoid unnecessary over-complicating of things. I tried to add in click animations but it will only appear and then disappear
Instead of using animations, you can toggle the transparency of the image between 0 (totally transparent) and 1 (totally solid) when click happens to achieve disappearing and appearing.
Related
I also want to when I click on the background and there are other pressable things/buttons on this background, they are not being pressed unless the state is back to when it is un-blurred (basically: only the blurred background can be pressed when the screen is blurred). If you need an example look at twitter mobile: when you click on the post (+) button, it blurs the background but when clicked back it un-blurs it. (Must work for IOS and Android).
I think you need this..
In CSS create 2 classes - First one with the blur and second one without.
In React create 2 functions - 1 onclick for the blur-button and 1 onclick for the close button. These functions should change the class of body.
$('.button').click(function(){
$('body').addClass('blur'); });
I have a basic create-react-app with Material/MUI text field and button. When I tab from the textfield to the button, it creates an animation on the button where the middle part slightly grows and shrinks. I'm trying to figure out how to get rid of that animation and just show a simple button that has focus. Toggling the options in Chrome debugger hasn't helped me track down where this animation is being created (focus, hover, etc.). In fact, anytime I change any property in the CSS panel it turns the animation off and makes it harder to track down what is causing this.
Thanks.
So I'm working on implementing a Material-UI modal, and ran into the issue where the appearance and disappearance of the scrollbar shifts the modal every single time it closes. I can fix this with the "mui-fixed" class, but it adds extra padding on the right side of the modal that looks bad.
I'm just generally curious if there's a better way to fix this problem with the scrollbar disappearing and reappearing, or if there's a way to accomplish this using "mui-fixed" without the padding on the right.
Setting the padding to 0 simply makes it act like the "mui-fixed" class wasn't included in the first place, which causes the scrollbar shift issue again.
This is the padding that doesn't look right on the side of my modal window when "mui-fixed" is added.
Here's the modal WITHOUT the "mui-fixed" class.
Here's the modal WITH the "mui-fixed" class.
Update-- I figured it out. The reason why this was occurring was because I had a custom scrollbar that was offsetting the modal. I just removed my ::webkit-scrollbar and ::webkit-scrollbar-thumb classes and everything works great now.
I have a dialog that contains a few text fields where the user can provide input, like this.
The problem im having is that whenever the user clicks on one of the textfields , the mobile keyboard messes everything up. It looks like this:
I want to have the dialog remain the same - as in, it shouldnt shrink and force the user to scroll down to see the full dialog. I tried using the FullscreenDialog-component, but the problem remains the same - the mobile keyboard just shrinks it and makes it scrollable for some reason. Is there any way to fix this?
EDIT I found a way to sort-of fix this, at least temporarily - add a minHeight to the bodyStyle in the dialog and the keyboard won't overwrite it. Obviously you have to move the dialog up so that the keyboard doesn't block it when it appears :)
I've experienced a similar problem but the solution may not help in every situation.
In my case, the main <Paper /> component height was set to window.innerHeight and another <Paper /> component inside it was set to about window.innerHeight * 0.6. I use this and not simply a CSS unit 'vh' since it compensates for the URL bar.
In the nested paper, I had a <TextField /> and the same problem you described occurred. The solution is basically to listen to onresize event since it fires when the keyboard opens, then you simply use the maxheight of all those measures.
To make it perfect you may want to respect device rotation since it really does require you to use the new height, and of course make sure the component is positioned correctly.
The effect I'm looking for is a bit hard to describe, but I'm basically trying to implement a header above a scrollView which allows you to scroll normally when touching inside the scrollView, but then when you drag up out of the scrollView onto the header, it moves the header up.
This effect is used with the iPhone keyboard as a footer for messages for example, where you can scroll through messages normally and the keyboard will stay. However, if you scroll down into the keyboard, it drags the keyboard down.
https://facebook.github.io/react-native/docs/scrollview.html#keyboarddismissmode 'interactive' is the effect I'm trying to achieve, but instead of for a keyboard I'm looking to do it for some custom header component which is above my scrollView.
I figure I could match the scroll to the components Y translate Y, however I only want to do this depending on where my touch is. Sadly, the onScroll event doesn't seem to contain any information on the touch location, so I can't tell where the user is dragging. Any help or ideas for other ways to implement this would be greatly appreciated.