GithubHelp home page GithubHelp logo

Comments (2)

ElliotGarbus avatar ElliotGarbus commented on May 22, 2024 1

@FilipeMarch Here is a workaround.

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.textinput import TextInput
from kivy.properties import NumericProperty

kv = """
AnchorLayout:
    ScrollBackTextInput:
        size_hint: None, None
        size: dp(150), dp(30)
        multiline: False
        scroll_back: self.width - 20  # scroll back is related to the size of the text box
"""


class ScrollBackTextInput(TextInput):
    scroll_back = NumericProperty(90)

    def on_text(self, *args):
        if self.x + self.padding[0] >= self.cursor_pos[0]:
            # cursor is on left hand side, padding[0] is padding on the left
            # if the cursor hits the left hand side, scroll to the left
            self.scroll_x = max(0, self.scroll_x - self.scroll_back)


class TiTestApp(App):
    def build(self):
        return Builder.load_string(kv)


TiTestApp().run()

from kivy.

Julian-O avatar Julian-O commented on May 22, 2024

Closing as duplicate of #4951.

If you think this is in error, please let us know.

from kivy.

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.