React-ace: How to set `editor.$blockScrolling = Infinity`?

Created on 3 Aug 2015  路  9Comments  路  Source: securingsincity/react-ace

I鈥檓 getting these warnings:

Automatically scrolling cursor into view after selection change this will be disabled in the next version set editor.$blockScrolling = Infinity to disable this message

Where should I set editor.$blockScrolling = Infinity to prevent these warnings?

Most helpful comment

@KevinMongiello try this:

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

All 9 comments

please merge this fix by Evan, just came here to ask the same thing :) thanks!

I'm still getting these warnings in the console.
Sounds like it was fixed though.
Is there something I have to set to avoid the warnings?

@mingfang Default value is 0. I tried to set as editor.$blockScrolling = 1 and console logs gone.

@mskasal thanks

@mskasal I did but this does not solve the issue:

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
                }
            });

where

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 Try this. This worked for me.

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

How does this work in jsx? <ReactAce $blockScrolling={<value>} /> doesn't work where value = Infinity, 1, "Infinity", etc.

@KevinMongiello try this:

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

ahh thanks :) @oluckyman

Was this page helpful?
0 / 5 - 0 ratings

Related issues

levi0913 picture levi0913  路  7Comments

ponelat picture ponelat  路  3Comments

BenBrewerBowman picture BenBrewerBowman  路  5Comments

kolbinski picture kolbinski  路  5Comments

dmavrin picture dmavrin  路  3Comments