Cursor not lining up with text and syntax highlighting, indent, etc not working
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- nextjs, react, typescript
- Ambito
- frontend
Direzione di ricerca
Reproduce the report using the Next.js configuration and the CodeEditor component shown in the issue, starting with the supplied JSON example. Compare cursor alignment, auto-indentation, and syntax highlighting while typing. The issue is complete when the cursor tracks the displayed text and the reported editor features work correctly in this setup.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione

If you look at the gif you can see that the cursor is actually above where the input appears. When you type it's really difficult to know where your input is going to appear and it seems erratic. Also the auto-indent doesn't seem to work and there's no syntax highlighting.
Here's my code:
import React, { useState } from 'react';
import dynamic from 'next/dynamic';
const ReactJson = dynamic(
() => {
return import('react-json-view');
},
{ ssr: false },
);
const CodeEditor = dynamic(
// @ts-ignore
() => import("@uiw/react-textarea-code-editor").then((mod) => mod.default),
{ ssr: false }
);
function ConfigJsonViewerComponent(props: any) {
const config: any = props.config;
const [editableConfig, setEditableConfig] = useState(JSON.stringify(config, null,'\r'))
function onEdit(editObj: any): boolean {
setEditableConfig(editObj);
return true;
}
// @ts-ignore
return (
<div>
<div>
<h3>
Configuration <i>{edited ? '(edited)' : ''}</i>
</h3>
<CodeEditor
// @ts-ignore
value={editableConfig}
language="json"
placeholder={editableConfig}
onChange={(e: any) => onEdit(e.target.value)}
style={{
fontSize: 12,
backgroundColor: "#f5f5f5",
fontFamily:
"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace"
}}
/>
</div>
)}
</div>
);
}
export default ConfigJsonViewerComponent;
This is a next.js app so my next.js config looks like this:
const removeImports = require("next-remove-imports")();
module.exports = removeImports({
experimental: { esmExternals: true },
distDir: 'build',
webpack: config => {
return {
...config,
node: { __dirname: true },
};
}
});
- Lingua principale
- TypeScript
- Stelle
- 575
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uiwjs/react-textarea-code-editor
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
uiwjs/react-textarea-code-editor#186 · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
uiwjs/react-textarea-code-editor#183 · 1 commento · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
uiwjs/react-textarea-code-editor#182 · 3 reazioni ·
-
fail to show line numberAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
uiwjs/react-textarea-code-editor#181 · 4 commenti · 12 reazioni ·
Tutte le issue di uiwjs/react-textarea-code-editor
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
supabase/agent-skills#611 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
polka-codes/test#345 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
GoogleChromeLabs/project-sesame#217 ·
I maintainer di solito rispondono entro 12 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
solana-foundation/solana-com#2202 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100