Skip to main content

All Questions

Tagged with
10,010 questions with no upvoted or accepted answers
8 votes
1 answer
6k views

Closing a react bootstrap modal with escape key

I have 6 buttons which, when clicked, activate a modal. This is written in React. //Since I have 6 different modals, giving each of them an id would distinguish them onCloseModal(id) { this....
patrickhuang94's user avatar
7 votes
1 answer
2k views

Slider does not work in react-slick with typescript

I am using the typescript version (@types/react-slick) of the react-slick library to implement carousel/slider in a Nextjs project. I am getting the following error after importing the Slider ...
Bello Shehu's user avatar
7 votes
4 answers
9k views

Open and Close Dropdown menu on by mouse hover in react js

I am new to React JS. My problem is that I want the menu to disappear if the mouse leaves that area, so I tried onMouseOut and onMouseLeave to close the menu but it seems that when this option is ...
Durai DD's user avatar
  • 187
7 votes
0 answers
2k views

ReactJS - Refused to apply inline style because it violates the following Content Security Policy directive

I get the following error in the browser inspector (Chrome, Brave, Safari) when I load my ReactJS project in Production: Refused to apply inline style because it violates the following Content ...
Sergi Juanati's user avatar
7 votes
2 answers
10k views

'outlined' not working in Material UI Select

I am implementing Material UI `Select' for which values are coming from backend. Below is my code <FormControl variant="outlined" className={classes.formControl}> <InputLabel ref={...
Lara's user avatar
  • 2,971
7 votes
1 answer
3k views

Importing CSS from node_modules with Parcel

I am currently migrating as React project built with Webpack into Parcel as an experiment to see what the hype is all about. The project uses Reactstrap, which has Bootstrap as a dependency. I have a ...
Vidya's user avatar
  • 30.2k
7 votes
2 answers
6k views

Bottom Fixed div getting pushed up with android keyboard

I have a fixed div at the bottom, but in response view, in android, it gets pushed up with the keyboard. const ContactBackgroundImage = styled.div` color: white padding: 50px height: 118px ...
Nick Bb's user avatar
  • 601
7 votes
0 answers
1k views

Compilation Failure when Making a Production Build with create-react-app v2

Creating an optimized production build... Failed to compile. Lexical error on line 1: Unrecognized text. Erroneous area: 1: $progress-size - 2 * $border-size ^..^ I encounter the above compilation ...
Khoa Nguyen's user avatar
7 votes
0 answers
7k views

Properly pushing a Canvas with Material UI Persistent Drawers

I have an application with two expandable toolbars. The left toolbar functions as intended, but I have not been able to make the right toolbar push the content properly. See the code below. I copied ...
Seth Duncan's user avatar
  • 1,280
7 votes
1 answer
3k views

Keeping sticky positioning behaviour when sticky elements are inside a container (because of React having to render a single parent element)

I have a top section above some main content. The top section comprises 5 parts: a 'main header', 3 'categories', and 'settings'. Given the user scrolls down the page, the 'main header' stays sticky ...
alanbuchanan's user avatar
  • 4,153
7 votes
3 answers
2k views

Link stylesheet with media query to React component

In an html file it is possible to link stylesheets like this: <link rel="stylesheet" media="(min-width: 768px)" href="small.css"> <link rel="stylesheet" media="(min-width: 1150px)" ...
Sunny's user avatar
  • 155
7 votes
1 answer
3k views

Using css-loader inline with Webpack + React

I'm building my React app with Webpack, and css-loader w/modules. I love it. Most of my stylesheets are very small, though, and I'd like to inline them within the same JSX file as my markup and ...
user avatar
6 votes
0 answers
737 views

Virtual keyboard in Safari causes black space under app body and scrolling outside of it

I'm creating a chatbot app in React. It works fine on other browsers but on Safari whenever the virtual keyboard is open it causes the entire body to become draggable, the scrollbar extends way below ...
FlexboxFanatic's user avatar
6 votes
2 answers
1k views

javascript - How to start update scroll percentage when element is on the top of viewport

When entering the website, this is the first UI you'll see. Then, if you scroll down to the very beginning of section B I expect the section B will become sticky and the currentPercentage state will ...
CCCC's user avatar
  • 6,213
6 votes
4 answers
3k views

Make Tailwind Classes non-Global (automatically!)

I have an application made up of two parts: (A) legacy application (AngularJs) with its own CSS classes. (B) div containing a completely new application (React). B is built with webpack, postcss and ...
Domi's user avatar
  • 23.8k

15 30 50 per page