All Questions
807 questions
3
votes
1
answer
46
views
Want wrapped content to expand only downwards with CSS
I have a searchfield that autofills with different quippy lines that may or may not need to wrap to fit all the words. This is anchored to a centered parent that makes sure that the searchfield ...
0
votes
0
answers
39
views
Is there a way to use the main scrollbar for a popup?
Title: Use main scrollbar to control popup scroll, freeze body background scroll without popup scrollbar
Question:
I'm trying to implement a popup/modal on my website that only uses the main scrollbar ...
0
votes
2
answers
48
views
How to display long dropdowns in a `fixed` viewport?
I have a customized date picker (for the context its height is 1050px). I want to display it in a popup within dropdown content. This is my popup component.
<div
className={styles.popupWrapper}
&...
-3
votes
3
answers
73
views
What is the simplest possible way to get a div button to hide its parent div on click in React.js [closed]
I have a task that is simple (one line) in plain HTML/CSS/JS, but I can't find a simple and working method in React.
I have a parent div, and it has two children. The second child is the meaningful ...
-1
votes
1
answer
62
views
Full Screen background image in React
I'm trying to create a website using typescript + React but I'm having some issues. I have embedded a video into my website that I want to be the background for the first section but no matter what I ...
-1
votes
1
answer
42
views
How to resize an SVG without also resizing the background
I want to use SVG as logo of my website.
I tried to resize it by modifying its width and height, but it doesn't work, because it resizes the whole image.
I also tried these solutions:
Resizing SVG in ...
1
vote
1
answer
61
views
How can I set the table tr in css module (nested css)
I am using css module like this ,
.catTable{
border:1px black solid;
}
in jsx
import styles from "../css/basic-styles.module.css";
return (
<table className={styles.catTable}>
...
3
votes
1
answer
104
views
Fixing Transparent Line Between Div with Clip-Path and Parent Div
A thin, transparent line appears between the triangular div and its parent div when zoomed. I believe this is likely caused by anti-aliasing in the browser. If there is a way to fix this, I would ...
1
vote
1
answer
48
views
HTML Table is not overflowing its container
I am trying to make an html table overflow its container to have a scrollbar on mobile, but it is not working.
Here's the code:
export default function Stats({ pokemon }: { pokemon: PokemonWithColor })...
0
votes
1
answer
36
views
Tailwind css - div not filling all the way to the top of given space when placed in a grid
I'm working on a personal website and am confused as to what is happening here.
I have a grid of 6 columns, in which 5 columns are taken up by a "GridItem", and have an additional leftover ...
0
votes
1
answer
46
views
My Radio Buttons Are Grouped on the Same Line (Left, Middle, Right). I Clicked The Label for the Second Radio Button and the First One is Selected
I have three radio buttons, all on the same name. When I clicked the first one, it selects the first on. When I click the second one (Need to click the bubble), it selects the second one. When I ...
0
votes
0
answers
24
views
React Conditional Rendering: div changes size when using empty div
I have a grid set up like this in a JSX element:
<div className={"board"}>
{board.tiles.map((tile, index) => (
<TileView
key={index}
value={...
1
vote
0
answers
21
views
Different behavior between React and pure HTML post drag and drop
For some reason, when hovering over the red div (child) after drag and drop, the onMouseMove event of the blue div (parent) is not triggered in React, but it is triggered in pure HTML.
Example:
Test ...
2
votes
1
answer
59
views
React Element with HTML Parameters Not Rendering
On a page, I have a element embedded in HTML:
{dataTable}
Which is initialised as:
const [dataTable, setDataTable] = useState(<p>Data Table Loading...</p>);
And updated in a useEffect ...
1
vote
1
answer
35
views
React Dialog Modal Is Appearing before User Clicks the intended button
I have a todo app which I am working on, the intended flow is for the user to input their "Todo" and click create which adds the todo to a list of Todos, with each todo then getting an edit ...
0
votes
0
answers
33
views
Divide the content into pages. React
I have a problem, I need to separate the content if it exceeds 980 pixels . But I can't do it. Here is an example of an array of objects with pages , as well as the display code
[
{
"...
0
votes
0
answers
18
views
Issue with Logo Container Margin Disappearing After Webpage Refresh
Description: I’m encountering an issue with the marginTop of my logo container in a React application. After refreshing the webpage, the marginTop value seems to disappear, causing layout problems. ...
2
votes
1
answer
47
views
how come motion component in framer motion start with lowercase?
I learned that React component names should start with a lowercase letter so that they can differentiate between custom components and inbuilt HTML components
how come motion.div in the Framer motion ...
-1
votes
1
answer
61
views
How do I enable Emmet Abbreviation in CodeSandbox.io?
Normally, when typing "div", there should be a recommendation from Emmet Abbreviation popping beside it, same with the other HTML elements, but there isn't. How can I fix this?
I tried going ...
0
votes
1
answer
50
views
How do I add a link to a page using TypeScript? I'm stuck on how to do it. I've tried one method, but it's not working
`<CommandItem><a href="@/src/app/page.tsx">Моя статистика</a></CommandItem>`
I tried it and it didn't work. I tried different methods on stackoverflow and they also ...
0
votes
0
answers
91
views
A form label must be associated with a control - jsx-a11y/label-has-associated-control
I have a html code block as in below in my react application which throws "A form label must be associated with a control" eslint warning under jsx-a11y/label-has-associated-control.
<...
-1
votes
1
answer
39
views
How to handle the states when disabling my component in react?
What I want is to make the TextPanel disabled if payStub has a value, and not be disabled if payStub does not have a value,
In my React code, I have the following:
const [payStub, setPayStub] = ...
0
votes
1
answer
715
views
'FormData': parameter 1 is not of type 'HTMLFormElement', I am getting this error but i can't fix it help pls
``your text`const authForm = useRef();
const handleSubmit = (e) => {
e.preventDefault();
//formData
let form = new FormData(authForm.current);
console.log(form)
}
This is the code of the form ...
0
votes
1
answer
48
views
Maintaining page centering with uneven divs on the sides
Here is what I want:
Here is what I'm getting:
DIV1 is centered in the center of the page
Here is my code using tailwind:
<div className="flex flex-col items-center justify-center mt-10&...
0
votes
5
answers
102
views
how to delete array data according to a certain index in reactjs [duplicate]
I want to try deleting the technologies data according to the index using the handleDeleteTechnology function but when I try to delete it and it works if I see the data in the data, but in the UI what ...
2
votes
2
answers
130
views
alert shows twice in react js [duplicate]
I have a puzzle game and it shows an alert once you are finished and then a confirm window asking if you want to solve another one. The problem that it shows this twice. I tried changing my index.js ...
0
votes
0
answers
34
views
Convert JSX String to Orignal JSX
I am getting this issue while converting jsx string to jsx. While rendering it and converting it to jsx still not working . I am giving string
const newhead = '<th className="px-6 py-3 text-...
-1
votes
1
answer
19
views
My "required" doesnt work when i let a input empty in JSX
Im making a register.jsx arquive, but when i click in the button, he works even with a input empty or undefined.
I dont know what im doing wrong, but i think that dont have syntax error
The Register....
0
votes
0
answers
28
views
Image accordion in .jsx but the images are too far apart from eachother
I am currently having an issue with my image accordion. The accordion I implemented works fine, but at rest the images are really far away from each other, and I want to have them touching. I have an ...
0
votes
1
answer
48
views
Modify CSS for Android and iOS
I'm making a responsive landing page but I'm having trouble modifying the HTML elements for Android and iOS. For example:
I change the font-size of an h1 but it doesn't change on iOS but it does on ...
0
votes
1
answer
49
views
Get unique key warning when add a key attribute to a div element with some sub nodes in it with react v18.2.0
The codes below will cause the warning: "Each child in a list should have a unique 'key' prop." when I try to render the div element into the page.
<div {...{}} key={"formKey"}&...
0
votes
1
answer
143
views
Auto render custom html tags in ReactJs
In basic HTML, we are almost free to use any tag we want. I can write code like this:
<card>
<header>
<logo>
<img src="..">
</logo>
<header&...
0
votes
1
answer
146
views
CSS: crolling left column with a sticky right column. Works but can't understand why
.sticky_show_container {
width: 100%;
display: flex;
justify-content: center;
height: 150vh;
}
.sticky_show_grid {
width: 90%;
display: grid;
grid-template-columns: 1fr ...
0
votes
1
answer
133
views
Form tag breaks document layout
Using React with Chakra UI. Found, that default <form> tag breaks layout. Adding and deleting <form> shows that only it affects layout. Components inside <form> appears like they are ...
0
votes
1
answer
671
views
"touchmove" event not working as expected in React
I am building an app in NextJS. I am trying to create a window manager in which you can drag and resize panels.
Everything works well on desktop, but on mobile, the event listeners are not behaving I ...
1
vote
0
answers
97
views
How to conditionally modify react-orgchart's orgChart CSS classes?
I'm making an organization chart that has collapsible nodes functionalities. These are the CSS classes that control the lines in the chart connecting the nodes:
#orgChart .orgNodeChildGroup ....
1
vote
1
answer
310
views
style = background-image url quotation turns into "
I am trying to make a catalog component where I can use the image, title, and description multiple time. This is the component code so far
import React from "react";
import '../pages/UI.css';...
1
vote
0
answers
32
views
Styles at media quary applies only partially
I am trying to make mobile navigation but my styles at medea applying only partially, to be precisely it applies background color but not flex styles.
JSX
import classes from "./Header.module....
0
votes
1
answer
37
views
state as an argument to access an object?
(i'm new to react btw)
So i'm trying to make a code that:
Reads the value of two select boxes and an input
Uses the value of the selects to read a Javascript object
Multiplies the value of the input ...
2
votes
1
answer
82
views
Reduce function shows NaN or Undefined when used along with map() function in JSX
I am trying to get the total from objects (product, sellingPrice) that renders dynamically on the screen after they have been entered through a form. I am using the map() function to loop through the ...
0
votes
1
answer
53
views
Issue with rendering HTML elements using a nested map JSX
I have a json file which has the required data. And I am looping through the data using .map() and rendering the details within HTML .When I add console statements instead of HTML I am able to see ...
0
votes
0
answers
242
views
How do you properly override the User Agent Stylesheet in a React Project?
From what I gather there is a precedence to inheriting CSS values, and elements inherit alot of their values from the User Agent Style Sheet in an attempt to set some standard. Im in chrome and the h5 ...
0
votes
1
answer
56
views
How do I fix the layering of my Navbar and Banner?
I'm using React & Tailwind, and I'm currently working on my Navbar and Banner.
As you can see from the photos below, although my page looks fine stylistically, I can't hover/click on my Events and ...
1
vote
1
answer
48
views
How can I reference logo.png files with names in my React application and display them dynamically for the tech stack of my projects section?
I'm working on a web development project where I have a list of projects, each with a title, description, and a technology stack. I want to display technology icons next to the names of the ...
0
votes
2
answers
2k
views
Implementing React in Electron application
I've been struggling implementing very simple react code in my electron desktop application.
If I execute the app, there is no error message, but only empty page.
I tried changing script type as "...
1
vote
2
answers
59
views
Changing the routing logic
I decided to improve the routing in the pet project and found such an opportunity in the guide so that it would be possible to add chats.
import React from 'react';
import { Routes, Route } from '...
1
vote
0
answers
25
views
`<input type="date" />` Update State in React only when a user hits Enter or picks a date through the date picker
I have tried the following so far:
import React, { useState } from 'react';
function DateInput() {
const [selectedDate, setSelectedDate] = useState('');
const handleDateChange = (event) => {
...
1
vote
0
answers
33
views
My react app keeps rendering and does not respect the if condition
I m trying to build an app in which you have to answer multiplication questions and every wrong question is saved and after you reach a certain score ( in this case 2 ) you have to reanswer them for ...
0
votes
2
answers
208
views
Image not being masked by SVG [duplicate]
The SVG that is meant to mask the image lies under the image and isn’t masking it. Also, adding WebkitMask to the inline style makes the image disappear from live server page. I'm using CSS modules, ...
0
votes
1
answer
175
views
Header's Logo Image Not Appearing Properly
I am rendering HTML using JSX and creating a header which has logo to the left side...but it is coming out to be in the way that is shown in my uploaded photo. I have also uploaded the corresponding ...