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