React-ace: ¿Cómo configurar `editor.$blockScrolling = Infinity`?

Creado en 3 ago. 2015  ·  9Comentarios  ·  Fuente: securingsincity/react-ace

Recibo estas advertencias:

Desplazamiento automático del cursor a la vista después del cambio de selección, esto se deshabilitará en la próxima versión del editor de conjuntos. $ blockScrolling = Infinity para deshabilitar este mensaje

¿Dónde debo configurar editor.$blockScrolling = Infinity para evitar estas advertencias?

Comentario más útil

@KevinMongiello prueba esto:

<ReactAce
  editorProps={{
    $blockScrolling: Infinity
  }}
/>

Todos 9 comentarios

combine esta solución de Evan, solo vine aquí para preguntar lo mismo :) ¡gracias!

Sigo recibiendo estas advertencias en la consola.
Aunque parece que se arregló.
¿Hay algo que deba configurar para evitar las advertencias?

@mingfang El valor predeterminado es 0 . Traté de establecer como editor.$blockScrolling = 1 y los registros de la consola desaparecieron.

@mskasal gracias

@mskasal lo hice pero esto no resuelve el problema:

this.editor = this._createEditor("editor");
            this.editor.$blockScrolling = 1;
            this.editor.setOptions({
                readOnly: true,
                highlightActiveLine: false,
                highlightGutterLine: false,
                onLoad: function (_editor) {
                    // This is to remove following warning message on console:
                    // Automatically scrolling cursor into view after selection change this will be disabled in the next version
                    // set editor.$blockScrolling = Infinity to disable this message
                    _editor.$blockScrolling = 1
                }
            });

donde

private _createEditor(element_name:string,onchange?:any){
            var editor:Editor = ace.edit(element_name);
            //editor.setTheme('ace/theme/monokai');
            editor.getSession().setMode('ace/mode/javascript');
            editor.getSession().setTabSize(4);
            editor.getSession().setUseSoftTabs(false);
            editor.getSession().setUseWrapMode(true);
            editor.setShowPrintMargin(true);
            return editor;
        }

@oluckyman @loretoparisi Prueba esto. Esto funcionó para mí.

var editor = ace.edit("editor");
editor.getSession().setMode("ace/mode/javascript");
editor.$blockScrolling = Infinito;

¿Cómo funciona esto en jsx? <ReactAce $blockScrolling={<value>} /> no funciona donde valor = Infinito, 1, "Infinito", etc.

@KevinMongiello prueba esto:

<ReactAce
  editorProps={{
    $blockScrolling: Infinity
  }}
/>

ah gracias :) @oluckyman

¿Fue útil esta página
0 / 5 - 0 calificaciones