- posisble fix for auto translation bug in editor component;
This commit is contained in:
@@ -65,36 +65,39 @@ const Wysiwyg = ({
|
|||||||
outlined
|
outlined
|
||||||
onClick={handleCleanValue}
|
onClick={handleCleanValue}
|
||||||
/> : null}
|
/> : null}
|
||||||
<Controller
|
<div translate="no">
|
||||||
name={fieldName}
|
<Controller
|
||||||
control={control}
|
name={fieldName}
|
||||||
defaultValue={defaultValue}
|
control={control}
|
||||||
rules={config}
|
defaultValue={defaultValue}
|
||||||
render={({ field, fieldState }) => (
|
rules={config}
|
||||||
<Editor
|
render={({ field, fieldState }) => (
|
||||||
ref={editorRef}
|
<Editor
|
||||||
id={field.name}
|
ref={editorRef}
|
||||||
readOnly={disabled}
|
id={field.name}
|
||||||
{...field}
|
readOnly={disabled}
|
||||||
headerTemplate={header}
|
{...field}
|
||||||
modules={{
|
headerTemplate={header}
|
||||||
clipboard: {
|
modules={{
|
||||||
matchers: [
|
clipboard: {
|
||||||
[Node.ELEMENT_NODE, function (node, delta) {
|
matchers: [
|
||||||
const ops = delta.ops.map((op) => ({ insert: op.insert }));
|
[Node.ELEMENT_NODE, function (node, delta) {
|
||||||
return new Delta(ops)
|
const ops = delta.ops.map((op) => ({ insert: op.insert }));
|
||||||
}]
|
return new Delta(ops)
|
||||||
]
|
}]
|
||||||
}
|
]
|
||||||
}}
|
}
|
||||||
placeholder={placeholder}
|
}}
|
||||||
onTextChange={(e) => field.onChange(e.htmlValue)}
|
placeholder={placeholder}
|
||||||
style={{ height: 80 * rows }}
|
onTextChange={(e) => field.onChange(e.htmlValue)}
|
||||||
className={classNames({ 'p-invalid': fieldState.invalid })}
|
style={{ height: 80 * rows }}
|
||||||
/>
|
className={classNames({ 'p-invalid': fieldState.invalid })}
|
||||||
)}/>
|
/>
|
||||||
|
)}/>
|
||||||
|
</div>
|
||||||
{infoText ? <small>{infoText}</small> : null}
|
{infoText ? <small>{infoText}</small> : null}
|
||||||
</>)
|
</>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Wysiwyg;
|
export default Wysiwyg;
|
||||||
@@ -470,15 +470,17 @@ const BandoViewBeneficiario = () => {
|
|||||||
<h2>{__('Non hai trovato la risposta che cercavi?', 'gepafin')}</h2>
|
<h2>{__('Non hai trovato la risposta che cercavi?', 'gepafin')}</h2>
|
||||||
<div className="appForm__field">
|
<div className="appForm__field">
|
||||||
<label htmlFor="newQuestion">{__('Fai una domanda', 'gepafin')}</label>
|
<label htmlFor="newQuestion">{__('Fai una domanda', 'gepafin')}</label>
|
||||||
<Editor
|
<div translate="no">
|
||||||
id="newQuestion"
|
<Editor
|
||||||
value={newQuestion}
|
id="newQuestion"
|
||||||
placeholder={__('Digita qui la tua domanda', 'gepafin')}
|
value={newQuestion}
|
||||||
headerTemplate={header}
|
placeholder={__('Digita qui la tua domanda', 'gepafin')}
|
||||||
onTextChange={(e) => setNewQuestion(e.htmlValue)}
|
headerTemplate={header}
|
||||||
style={{ height: 80 * 3 }}
|
onTextChange={(e) => setNewQuestion(e.htmlValue)}
|
||||||
aria-describedby="newQuestion-help"
|
style={{ height: 80 * 3 }}
|
||||||
/>
|
aria-describedby="newQuestion-help"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<small id="newQuestion-help">
|
<small id="newQuestion-help">
|
||||||
{__('Riceverai una notifica quando ti risponderemo', 'gepafin')}
|
{__('Riceverai una notifica quando ti risponderemo', 'gepafin')}
|
||||||
</small>
|
</small>
|
||||||
|
|||||||
Reference in New Issue
Block a user