Giter VIP home page Giter VIP logo

Comments (4)

emilk avatar emilk commented on May 28, 2024

Web stuff is not really my skill set, so any help here would be appreciated.

from egui.

canselcik avatar canselcik commented on May 28, 2024

Web stuff is not really my skill set, so any help here would be appreciated.

Would be happy to help. Am I understanding correctly that this is for mobile keyboard input support? Was this behind a feature flag in the past?

If this was for that, what's the intention behind changing the position of the canvas element at all? At a quick glance, it appears the intention would be to slide it up and down to accommodate the keyboard that would slide in on a mobile device but my assumption would be that the keyboard appearing would already have that effect.

from egui.

canselcik avatar canselcik commented on May 28, 2024

canselcik@be66734
How about something like this?

Since it is non-trivial accessing some configuration in that closure, I figured this would be a compromise-free option.

If the canvas isn't flush to the upper left corner of the page, pushing it up like it is currently done will result in potentially broken page layout. So if the canvas is flush to the upper left corner, we do what is currently done and then set an attribute on the canvas. We prefix it with data- as custom attributes doing that is allowed by the HTML5 spec. When the on screen keyboard is gone, we check for that custom attribute, if it is set, we unset it and "restore" the canvas back to the upper left corner of the page.

from egui.

jprochazk avatar jprochazk commented on May 28, 2024

The current workaround is to add some CSS to the canvas:

canvas {
  position: initial !important;
  top: unset !important;
}

Ideally, egui would never set the style of the canvas element for any reason.

from egui.

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.