Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
89 views

A few years ago I decided to migrate an old vanilla JS frontend to Lit as I could port the project in stages while keeping rest of code the same. Lit was mostly used for the reactivity component ...
ceds's user avatar
  • 2,245
0 votes
1 answer
63 views

I have that Quiz Editor - https://quiz-land.github.io/edit/XSZ5weNxLN. Link to the specific part of the code where the problems occur - https://github.com/.../main/src/views/editor.js/answers.js. When ...
user25038396's user avatar
0 votes
1 answer
579 views

I have an implementation I am trying to do with inputs which have the type range. These will be 2 inputs of type range, and I'm trying to get a 'double range' kind of implementation out of this. I am ...
OzerU's user avatar
  • 13
0 votes
2 answers
248 views

I'd like to make an SEO lit component where I can pass data to fill in meta tags, etc so I don't need to repeat them on every index page. If I place my component like so... <head> <script ...
Johnny Slack's user avatar
0 votes
0 answers
470 views

I've been conducting performance profiling to compare the rendering efficiency of React and LitElement, specifically focusing on a button component. However, the results are surprising, as LitElement ...
Geetanshu Gulati's user avatar
0 votes
0 answers
184 views

I am using [email protected] When building my typescript component it adds this as the my-component.d.ts: render(): import("lit-html").TemplateResult<1> | undefined; Problem is that this ...
Marc Rasmussen's user avatar
2 votes
1 answer
526 views

I'm trying to use base64 to show an image, BUT it only shows the encoded string but not the image. I copied it to a new file, and it showed correctly. This is the code: @customElement('image-board') ...
Jeefy's user avatar
  • 21
0 votes
1 answer
636 views

I am using render() to create and render using lit-html import { html, render } from 'lit-html'; const templateItems = []; const getChartInfo = (locationToRender) => { templateItems.push(html` ...
user7331530's user avatar
  • 1,005
0 votes
1 answer
70 views

Is there any way for an AsyncDirective to access its rendered parts after a setValue call? My directive's update method calls super.update which triggers the render method, but I need a method that's ...
aleclarson's user avatar
  • 19.2k
0 votes
0 answers
147 views

If i am using document listener anywhere in Lit Js and try to console event.target then it is printing only current element object instead of element which user has clicked. connectedCallback() { ...
Vinay Dhakre's user avatar
1 vote
2 answers
2k views

I Have React component. Now i am trying to import React Component in Lit Component. But React component is either not getting rendered nor it is throwing any error in the console. Is there any way to ...
Vinay Dhakre's user avatar
0 votes
1 answer
224 views

I've been working with Lit and recently I got into a weird issue where I couldn't get the property change detection in updated lifecycle callback when the property value (in this case: myProperty) is ...
Hitesh Misro's user avatar
  • 3,451
2 votes
0 answers
2k views

I want to create a reusable web components library made with Lit. These elements will be used with React, Angular, Vue and other framework as well. Now there is a problem, I am bundling these ...
Basit Qayoom's user avatar
0 votes
2 answers
338 views

I am implementing a Infinte Scroll Carousel with Lit. I want to control the carousel with key events. On long key press (or throttled) I want the animation te be fluid and stop at a specific place. Is ...
Liskovy's user avatar
0 votes
0 answers
221 views

I have created a Lit component in typescript. It is being exported as a named export. I am not able to register it in Vue 2 class component. Here are the issues I am facing: Issue 1: import { ...
veteran95's user avatar
1 vote
1 answer
402 views

I am using Lit-HTML ( NOT Lit-Element ) to build a html form. The form is very simple, it has 2 dropdowns: Population dropdown and Animal dropdown. The animal dropdown options depends on the selection ...
LHA's user avatar
  • 9,715
0 votes
1 answer
26 views

I have lit-html table that is using a template: export let catalogTemplate=(dataStringifiedDates,sortTableBy,submitsearchEGFNForm,submitsearchForm)=>html` <div class="tableLarge"> &...
Nikolay Dimov's user avatar
1 vote
0 answers
383 views

I want to set some attributes based on the attribute/property passed to my lit web component using one of the two approaches mentioned below: I am writing a test case to test a lit based web component....
Flying disk's user avatar
1 vote
1 answer
2k views

I have very simple Lit component with an attribute. I can change this attribute outside and Lit component receives new value and can display it, for example in the <input> tag. This operation ...
Pavel K's user avatar
  • 65
0 votes
1 answer
794 views

I'm trying to create a unit test for my lit-html element using jest. I want to check if the click event is working as expected. To test an event that changes from active to disable when clicked. // my-...
rluisn's user avatar
  • 1
0 votes
1 answer
634 views

I have lit-element based forms that are reused for editing entities. As an example consider a name form with the following fields <mwc-textfield id="first-name" label="First name&...
NicolasR's user avatar
  • 2,342
1 vote
0 answers
169 views

Within bit.dev, how can we import external stylesheets into bit.dev as we have an external styleguide we would like to import into our components within bit.dev. We are only using lit-elements within ...
Kyle's user avatar
  • 55
0 votes
0 answers
81 views

I am a JS student and have a project-like problem using page and lit-html. My task is to make a SPA through 'live server' and a server, which is initiated on my pc. I have to install page and lit-html ...
CrimsonLillith's user avatar
0 votes
1 answer
344 views

I am currently setting up a storybook project. One aspect of it, is showing the various icons we have as a part of the style guide. I am using svg-sprite to create a JSON file of all the svg's we have ...
OzerU's user avatar
  • 13
1 vote
1 answer
669 views

I have a basic Text Lit web component with a red color for styling as such import { LitElement, html } from "lit"; import { customElement } from "lit/decorators.js"; @...
Sam Scolari's user avatar
1 vote
1 answer
201 views

Let's say I have a data structure like this [{tag: 'h1', text:'lorem ipsum', attrs:{data-foo: 'bar'}}, {tag: 'blockquote', text:'dolor sit'}, {tag: 'p', text:'atmet'}] that I want to render into ...
nehalem's user avatar
  • 427
1 vote
2 answers
328 views

I have always been able to use https://github.com/nodecg/express-transform-bare-module-specifiers with Polymer 3 and browser sync. But now I am getting errors with the set up and lit element ...
dman's user avatar
  • 11.1k
1 vote
1 answer
930 views

In the below code, i am looping through a list of my data model (this.panel), and generating an input box for each. I would like to propagate any changes made by the user back to the model. to do ...
mike01010's user avatar
  • 6,204
1 vote
1 answer
1k views

I'm trying to implement classMap from lit-html. When I install the package my application stops working saying the following: Package path ./directives/unsafe-svg is not exported from package. This ...
Ricardo de Vries's user avatar
1 vote
1 answer
193 views

I have the following code using lit-html. const textarea = (note) => { return html`<textarea> ${note} </textarea>` } let array = [1, 2, 3] const rendered = () => { return ...
Jonathan's user avatar
  • 8,970
2 votes
1 answer
855 views

I have inherited an older project using jquery. I am modernising the code. In particular this $(selector).html("<h1>lol</h1>"); which as far as I understand is a full replacement ...
Clark's user avatar
  • 2,718
0 votes
2 answers
659 views

how to write below code lit html I am new to lit html , i try to convert the below code to if/else instead of nested ternary render() { return this.html` ${this.data ? this.html`<comp ...
John Ken's user avatar
  • 962
1 vote
1 answer
2k views

Recently we got a new ECMA 2022 standard approved and there is now a syntax to support private fields natively by prefixing # to the name. For years we have been using _ conventionally and now there ...
Dio's user avatar
  • 484
0 votes
1 answer
346 views

I am sorting an array of so called 'activities' in my customElement using LitElement: @property({ type: Array }) private activityListLocal: Array<Activity> = []; in the parent customElement ...
Keayne's user avatar
  • 1
3 votes
2 answers
6k views

Good time How to style dynamically in lit? My main goal is to change the color of an element according to the user's input in the input element. My code screen shoot
Sahbaee's user avatar
  • 33
0 votes
1 answer
827 views

I'm busy migrating a static js/html application to Lit. I'm finding the platform to be the most easy to migrate old static code to a framework. However, I'm having some big issues where rendered code ...
ceds's user avatar
  • 2,245
1 vote
1 answer
1k views

I am using Lit Custom Elements: I am using component A in my component B and want to access the property letters of B (from child to parent element). How do I do that? // Component A @customElement('a-...
Hans95's user avatar
  • 35
2 votes
2 answers
2k views

This is really odd: I'm using lit in a storybook (using @storybook/html). I do not know why, but in my environment lit does not update the component automatically when a property has been changed. If ...
Natasha's user avatar
  • 916
6 votes
2 answers
6k views

In lit/lit-html/lit-element, a standard component is the TemplateResult (usually HTMLTemplateResult), created like: function renderMe(msg) { return html`<div>Hello ${msg}!</div>`; } ...
Michael Scott Asato Cuthbert's user avatar
0 votes
1 answer
938 views

There is a lit element container-element which has has nested lit elements gmail-item. How do you apply styles to nested elements so that the last gmail-item has border-none? Currently, the styling li:...
stackcen's user avatar
  • 173
1 vote
1 answer
1k views

I have a really simple template and a simple nested template. Unfortunately, my nested template doesn't render anything. I followed the example defined at: https://lit.dev/docs/components/rendering/ ...
stackcen's user avatar
  • 173
0 votes
1 answer
501 views

When a lit component extends a mixin, style in component overrides style in mixin. Example: my-component.js export class HomePage extends ViewMixin(LitElement) { static styles = css` :host { ...
MadeInLagny's user avatar
2 votes
1 answer
5k views

Background I have tried several keywords but was not able to find a solution to disable prettier's quotes modification. I am working on a Polymer Lit project and I have tried a lot of things but it is ...
anees's user avatar
  • 1,885
2 votes
1 answer
1k views

I want to create a basic state management using Lit reactive controllers. The purpose is to share property values accross the application. The issue occurs when a controller is attached to a view and ...
MadeInLagny's user avatar
0 votes
0 answers
560 views

I'm implementing a (lit-element) webcomponent that has a css-grid that's specific per instance of the element. For now I set the grid-template property by the style attribute of the element, but as ...
Daniel van Mil's user avatar
1 vote
1 answer
247 views

Im trying to have a menu multiple options rendered onclick but also the possibility to get back to the menu with back button. I'm doing something wrong or it is just not possible and I might not have ...
Yohav Rn's user avatar
  • 229
2 votes
1 answer
4k views

I don't understand the concept of reactivity in lit's web components architecture. From other frameworks I come up with the assumption that the following example would update without problem, but it ...
sunwarr10r's user avatar
  • 4,795
2 votes
1 answer
882 views

I'm trying to use Material Custom Component and also using some other components. But I have version conflict Uncaught DOMException. Uncaught DOMException: Failed to execute 'define' on '...
Hiten B's user avatar
  • 61
0 votes
1 answer
2k views

I have a canvas element that should be resizing as the window resizes, but for some reason it doesn't change. The element should remain a square, taking up 80% of the view height. The relevant css ...
Ian Campbell's user avatar
4 votes
1 answer
2k views

I have been using as lit-html in my own custom web-component library. I have third party webcompobent : html`<lottie-player src=${state.url} background="transparent" speed="1" ...
Anurag Vohra's user avatar
  • 2,043

1
2 3 4 5