Comments (4)
#3311 (comment) - additional information on the topic.
from svelte.
Why do you need it when you, in general, control the content of non-contenteditable elements?
from svelte.
In my script, I get a block of code from a .md
file and wrap it in a component. The "Copy" button takes the contents of the code block and places it on the user's clipboard.
Now for this, I'm doing something like:
let codeElement: HTMLElement | undefined = $state()
let codeListing = $derived(codeElement?.innerText ?? '')
...
<div bind:this={codeElement}>
{@render children()}
</div>
but I'd like to do it this way:
let codeListing = $state('')
...
<div bind:innerText={codeListing}>
{@render children()}
</div>
from svelte.
What if, I make changes to innerHTML? DOM will be out of sync?
from svelte.
Related Issues (20)
- Reactivity not working on safari v12.5.7 HOT 1
- Svelte 5 watch derived change and run view-transition HOT 4
- Svelte 5 Map Reactivity issue HOT 3
- Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './types.js'?ts(2835) HOT 1
- SVG animation with in:draw and delay is visible before the animation HOT 2
- Element with a fade in animation flickers HOT 3
- Pass Prop with Syntax as Object HOT 5
- a11y: Add #show directive to support dynamic show/hide of elements while being screen reader compatible HOT 1
- Svelte 5: Confusing and unclear warning `state_referenced_locally` HOT 7
- Svelte 5: Add element tag template literal shorthand HOT 1
- Incorrect warning on <div style="scroll:auto" tabindex="0"> HOT 2
- Svelet 5 REPL: Error compiling component (too much recursion) HOT 5
- can't define property Symbol("$state"): Object is not extensible
- Svelte 5 REPL: not display error or warning wavy lines when first opened HOT 2
- Svelte 5: `svelte-ignore unused-export-let` is ignored HOT 2
- Svelte 5: Event target is not retargeted after shadow dom
- Svelte 5: `nit` Duplicated text in documentation
- Linter error `no-unused-vars` if property is `$bindable` and never read HOT 2
- Svelte 5: state_referenced_locally warning on exported states
- Svelte 5: Again some events are ignored under these certain circumstances.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte.