Giter Club home page Giter Club logo

Comments (7)

Rich-Harris avatar Rich-Harris commented on August 23, 2024 3

The blocker was me not knowing it existed

from sites.

Riyeshp avatar Riyeshp commented on August 23, 2024

Hi Rich.. I hope this piece of information will be of any help to you to track down this bug.

//ComponentSelector.svelte

		const component = {
			name: uid++ ? `Component${uid}` : 'Component1',
			type: 'svelte',
			source: ''
		};

		editing = component;

		setTimeout(() => {
			// TODO we can do this without IDs
			document.getElementById(component.name).scrollIntoView(false);
		}); 

"document.getElementById(component.name).scrollIntoView(false);" this line seems to be creating that jump in the web page.

from sites.

mrkishi avatar mrkishi commented on August 23, 2024

Related issue at sveltejs/svelte-repl#9 and PR at sveltejs/svelte-repl#10. I'm not sure what the right approach should be — what's the original intention for the scroll?

from sites.

Rich-Harris avatar Rich-Harris commented on August 23, 2024

@Riyeshp thanks

@mrkishi Without it, if you switch to (or create) a new component, CodeMirror updates the editor content, but retains the old scroll position, which is a bit unsettling

from sites.

mrkishi avatar mrkishi commented on August 23, 2024

@Rich-Harris Ah! Makes sense! Were there any blockers from using cm.swapDoc and CodeMirror's documents? If not, I can PR that in.

from sites.

Conduitry avatar Conduitry commented on August 23, 2024

I didn't know about swapDoc either. Does that seem like it could also be used to take care of sveltejs/svelte-repl#3 ?

from sites.

willamesoares avatar willamesoares commented on August 23, 2024

Is this still something we're looking at? And if so, is the PR at sveltejs/svelte-repl#10 still valid for fixing it?

from sites.

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.