Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
21 views

provide to a context based on consumed property in lit

Lit Playground Example As showed in my lit playground example, I want to pass a consumed context to provide a new context. But at the time of defining other properties, the consumed property is ...
Nils's user avatar
  • 324
0 votes
0 answers
14 views

How to bind keyboard events in Template of Lit Web Component

I have a Lit web component that contains a button with a click event. Simplified, it looks like this: <button @click=${props.onClick}> <!-- button content --> </button> The ...
ineedtoknow's user avatar
  • 1,569
-1 votes
1 answer
47 views

Catching errors with the lint:eslint script in the lit typescript starter project?

I'm testing the lint:eslint script in the lit element typescript starter project. I added a property with undefined any like this below the name property: /** * The name to say "Hello" ...
Ole's user avatar
  • 45.4k
0 votes
1 answer
43 views

Implementing attributeChangedCallback in Typescript?

In this tutorial attributeChangedCallback is implemented like this: // attribute change attributeChangedCallback(property, oldValue, newValue) { if (oldValue === newValue) return; this[ property ]...
Ole's user avatar
  • 45.4k
0 votes
0 answers
35 views

lit-html autocomplete in a NX monorepo

I'm trying to setup a NX monorepo with packages and apps. The libs in packages will be web-components written using Lit. My setup builds and runs just fine, but I'm struggling to get autocompletion ...
ezand's user avatar
  • 79
0 votes
0 answers
57 views

Highlight js import not working in lit components (es / eslint issue)

Have this piece of code in a lit component; import {LitElement, html, property, CSSResultArray, TemplateResult, unsafeCSS} from 'lit-element'; import { customElement, query } from 'lit/decorators.js'; ...
Prashant Singh's user avatar
0 votes
0 answers
51 views

Lit Web Component "object" properties are not visible in storybook "show code" code snippet

I have a requirement to develop web component library using Lit which will be used in multiple projects. In that library, one of the web component I required to develop is Chart web component. This ...
YATIN GUPTA's user avatar
1 vote
1 answer
73 views

Using the Lit javascript module over a CDN without the Lit dependencies bundled in?

Is there a way to serve a the Lit element built from typescript without the Lit dependencies being bundled in with the web component? For example we can serve the rollup bundle as described here from ...
Ole's user avatar
  • 45.4k
-1 votes
1 answer
54 views

Using the unpkg CDN to serve the Lit 3.0 my-element demo

With Lit 2.0 we could publish a web component to npm and use it via a script tag like this one. <script src="https://unpkg.com/@fireflysemantics/fs-gist"></script> That ...
Ole's user avatar
  • 45.4k
2 votes
0 answers
174 views

Web Test Runner setup issue - keep getting TypeError

I am trying to set up the testing environment for my Vite Lit.js project. I have installed WTR with esBuild plugin to handle typescript. When I run my tests I keep gettin the error below. 🚧 Browser ...
mbnxx's user avatar
  • 45
0 votes
0 answers
70 views

Is there a way to implement render reactivity in a Lit directive?

I'm using Lit 2.7.6 and am trying to implement a directive that can be used inside of a component. I tried to get a working StackBlitz example to share, but there was an issue with the imports from ...
kobo's user avatar
  • 31
0 votes
2 answers
76 views

How to handle mousedown in lit

I have the a list of thumbnails that are rendered to the screen as follows: <div class="color" style="background:${rgbToHex(color.value.r, color.value.g, color....
Rue Vitale's user avatar
  • 1,767
0 votes
0 answers
23 views

when running lit-localize - getting error - TS2324: Expected at least 2 arguments to msg(), got 1 on all uses of msg('some text')

I get - error TS2324: Expected at least 2 arguments to msg(), got 1 for all uses of msg. Not sure what we have done wrong tried to run the example project also but it doesn't build FYI [Lit] - ...
SwordPhish23's user avatar
0 votes
0 answers
87 views

Mixin extends another Mixin in Typescript

I have the following mixin: type Constructor<T> = new (...args: any[]) => T; export declare class MixknAInterface { // methods goes here } export const MixinA = <T extends ...
iPhoneJavaDev's user avatar
0 votes
1 answer
83 views

mwc-textfield input pattern not working for backslash or vertical bar

I am trying to add a pattern to a mwc-textfield input to filter a file name. My pattern seems to be valid js regex and seems to work on a html input but does not as a pattern on a mwc-textfield. I ...
Harry's user avatar
  • 39

15 30 50 per page
1
2 3 4 5
7