You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/components/input.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ Queste props di `<input>` sono rilevanti sia per input non controllati che contr
108
108
109
109
## Usage {/*usage*/}
110
110
111
-
### Displaying inputs of different types {/*displaying-inputs-of-different-types*/}
111
+
### Visualizzare input di tipi diversi {/*displaying-inputs-of-different-types*/}
112
112
113
113
Per visualizzare un input, renderizza un componente `<input>`. Per impostazione predefinita, sarà un input di testo. Puoi passare `type="checkbox"` per una checkbox, `type="radio"` per un radio button, [o uno degli altri tipi di input.](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types)
114
114
@@ -155,7 +155,7 @@ input { margin: 5px; }
155
155
156
156
---
157
157
158
-
### Providing a label for an input {/*providing-a-label-for-an-input*/}
158
+
### Fornire un'etichetta per un input {/*providing-a-label-for-an-input*/}
159
159
160
160
Di solito, posizionerai ogni `<input>` all'interno di un tag [`<label>`](https://developer.mozilla.org/it/docs/Web/HTML/Element/label). Questo indica al browser che questa etichetta è associata a quell'input. Quando l'utente clicca sull'etichetta, il browser metterà automaticamente a fuoco l'input. È anche essenziale per l'accessibilità: uno screen reader annuncerà la didascalia dell'etichetta quando l'utente mette a fuoco l'input associato.
161
161
@@ -190,7 +190,7 @@ input { margin: 5px; }
190
190
191
191
---
192
192
193
-
### Providing an initial value for an input {/*providing-an-initial-value-for-an-input*/}
193
+
### Fornire un valore iniziale per un input {/*providing-an-initial-value-for-an-input*/}
194
194
195
195
Puoi specificare facoltativamente il valore iniziale per qualsiasi input. Passalo come stringa `defaultValue` per gli input di testo. Checkbox e radio button dovrebbero specificare il valore iniziale con il booleano `defaultChecked`.
196
196
@@ -242,7 +242,7 @@ input { margin: 5px; }
242
242
243
243
---
244
244
245
-
### Reading the input values when submitting a form {/*reading-the-input-values-when-submitting-a-form*/}
245
+
### Leggere i valori degli input all'invio di un form {/*reading-the-input-values-when-submitting-a-form*/}
246
246
247
247
Aggiungi un [`<form>`](https://developer.mozilla.org/it/docs/Web/HTML/Element/form) attorno ai tuoi input con un [`<button type="submit">`](https://developer.mozilla.org/it/docs/Web/HTML/Element/button) all'interno. Chiamerà il tuo gestore di eventi `<form onSubmit>`. Per impostazione predefinita, il browser invierà i dati del form all'URL corrente e aggiornerà la pagina. Puoi sovrascrivere questo comportamento chiamando `e.preventDefault()`. Leggi i dati del form con [`new FormData(e.target)`](https://developer.mozilla.org/en-US/docs/Web/API/FormData).
248
248
<Sandpack>
@@ -310,7 +310,7 @@ Per impostazione predefinita, un `<button>` all'interno di un `<form>` senza att
310
310
311
311
---
312
312
313
-
### Controlling an input with a state variable {/*controlling-an-input-with-a-state-variable*/}
313
+
### Controllare un input con una variabile di state {/*controlling-an-input-with-a-state-variable*/}
314
314
315
315
Un input come `<input />` è *non controllato.* Anche se [passi un valore iniziale](#providing-an-initial-value-for-an-input) come `<input defaultValue="Initial text" />`, il tuo JSX specifica solo il valore iniziale. Non controlla quale dovrebbe essere il valore in questo momento.
316
316
@@ -423,7 +423,7 @@ p { font-weight: bold; }
423
423
424
424
---
425
425
426
-
### Optimizing re-rendering on every keystroke {/*optimizing-re-rendering-on-every-keystroke*/}
426
+
### Ottimizzare la ri-renderizzazione a ogni battitura {/*optimizing-re-rendering-on-every-keystroke*/}
427
427
428
428
Quando usi un input controllato, imposti lo state a ogni battitura. Se il componente che contiene il tuo state ri-renderizza un albero grande, questo può diventare lento. Ci sono alcuni modi per ottimizzare le prestazioni di ri-renderizzazione.
429
429
@@ -473,7 +473,7 @@ Se non c'è modo di evitare la ri-renderizzazione (ad esempio, se `PageContent`
473
473
474
474
## Troubleshooting {/*troubleshooting*/}
475
475
476
-
### My text input doesn't update when I type into it {/*my-text-input-doesnt-update-when-i-type-into-it*/}
476
+
### Il mio input di testo non si aggiorna quando digito {/*my-text-input-doesnt-update-when-i-type-into-it*/}
477
477
478
478
Se renderizzi un input con `value` ma senza `onChange`, vedrai un errore nella console:
479
479
@@ -511,7 +511,7 @@ Se il valore è intenzionalmente in sola lettura, aggiungi una prop `readOnly` p
511
511
512
512
---
513
513
514
-
### My checkbox doesn't update when I click on it {/*my-checkbox-doesnt-update-when-i-click-on-it*/}
514
+
### La mia checkbox non si aggiorna quando la clicco {/*my-checkbox-doesnt-update-when-i-click-on-it*/}
515
515
516
516
Se renderizzi una checkbox con `checked` ma senza `onChange`, vedrai un errore nella console:
517
517
@@ -555,7 +555,7 @@ Se la checkbox è intenzionalmente in sola lettura, aggiungi una prop `readOnly`
555
555
556
556
---
557
557
558
-
### My input caret jumps to the beginning on every keystroke {/*my-input-caret-jumps-to-the-beginning-on-every-keystroke*/}
558
+
### Il caret dell'input salta all'inizio a ogni battitura {/*my-input-caret-jumps-to-the-beginning-on-every-keystroke*/}
559
559
560
560
Se [controlli un input,](#controlling-an-input-with-a-state-variable) devi aggiornare la sua variabile di state al valore dell'input dal DOM durante `onChange`.
561
561
@@ -592,7 +592,7 @@ Se questo non risolve il problema, è possibile che l'input venga rimosso e ri-a
592
592
593
593
---
594
594
595
-
### I'm getting an error: "A component is changing an uncontrolled input to be controlled" {/*im-getting-an-error-a-component-is-changing-an-uncontrolled-input-to-be-controlled*/}
595
+
### Ricevo un errore: "A component is changing an uncontrolled input to be controlled" {/*im-getting-an-error-a-component-is-changing-an-uncontrolled-input-to-be-controlled*/}
596
596
597
597
598
598
Se fornisci un `value` al componente, deve rimanere una stringa per tutta la sua vita.
0 commit comments