Giter VIP home page Giter VIP logo

Comments (9)

oluckyman avatar oluckyman commented on September 26, 2024 29

@KevinMongiello try this:

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

from react-ace.

harshapps avatar harshapps commented on September 26, 2024 3

@oluckyman @loretoparisi Try this. This worked for me.

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

from react-ace.

brokenalarms avatar brokenalarms commented on September 26, 2024

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

from react-ace.

mingfang avatar mingfang commented on September 26, 2024

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?

from react-ace.

mskasal avatar mskasal commented on September 26, 2024

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

from react-ace.

mingfang avatar mingfang commented on September 26, 2024

@mskasal thanks

from react-ace.

loretoparisi avatar loretoparisi commented on September 26, 2024

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

from react-ace.

KevinMongiello avatar KevinMongiello commented on September 26, 2024

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

from react-ace.

KevinMongiello avatar KevinMongiello commented on September 26, 2024

ahh thanks :) @oluckyman

from react-ace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.