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

I have three custom components, MyParentElement and MyChildElement1 and MyChildElement2: class MyParentElement extends HTMLElement { connectedCallback() { console.log('MyParentElement ...
luckycoder's user avatar
2 votes
0 answers
70 views

I have my custom HTMLElement that looks like this export class MyCustomElement extends HTMLElement { // ... } customElements.define("my-custom-element", MyCustomElement); and my css *[...
lviggiani's user avatar
  • 6,178
0 votes
0 answers
94 views

Edit ############ I had omitted the fact that this is an extension code, which seems a crucial information. I have realized the problem is probably not caused by race of any of my functions but rather:...
siery's user avatar
  • 559
1 vote
1 answer
177 views

How can I change the following light DOM custom element to show the content of the default slot between (!!!) the two horizontal rulers? Please be aware, that I cannot use shadow DOM in my use case. &...
Natasha's user avatar
  • 916
0 votes
2 answers
77 views

I have an app with vanilla custom elements, like this: class CardComponent extends HTMLElement { static get observedAttributes() { return ['header', 'text']; } constructor() { super(); ...
Chen Peleg's user avatar
  • 3,252
3 votes
0 answers
75 views

I have a custom element, let's say it's called <cust-elem>. Assume that <cust-elem></cust-elem> renders to <a href="#">Foo</a>, but inside a shadow DOM. Since ...
Jonas Mechtheim's user avatar
0 votes
1 answer
76 views

I expect the two "forms" in the snippet below to behave the same when a <button> is clicked. A click on the button should submit the <form>. What I observe, however, is that it ...
lyfeng's user avatar
  • 78
0 votes
0 answers
59 views

Details: I have two completely separate Angular applications. One is like parent one and other one is child. Child should be exported as js module, loaded by parent app and embedded into some ...
Dalantren's user avatar
1 vote
1 answer
115 views

I'm creating a custom element and looking for a good way to pass in an object representing its initial state. I'm thinking my html would look something like this: <my-component id="...
UnhandledException's user avatar
1 vote
0 answers
21 views

It is possible to use CSS' @property rule to define CSS variables like in the following example (https://codepen.io/sbhmn/pen/pvzmvvx): <style> @property --bg-color { syntax: "*"; ...
SUBHUMAN's user avatar
  • 378
-3 votes
2 answers
65 views

If we define a property like this on a color-span custom element: static get observedAttributes() { return ['bgc']; } And get a reference to an instance like this while also changing the bgc ...
Ole's user avatar
  • 48.2k
1 vote
0 answers
233 views

How to build a Svele-Component without shadow-DOM? There are a lot of discussions on GitHub 1748 (2018) 4073 (PR / 2019) 2516 (2019 / with Comment from Rich Harris, but he also had no clear answer) ...
chmich's user avatar
  • 1,195
0 votes
1 answer
235 views

I have a template that includes script content, all of which is attached to the shadow DOM of custom element. How to make this script query shadow DOM instead of Light DOM given it is part of the ...
latvian's user avatar
  • 3,245
0 votes
1 answer
70 views

I am having hard time to move all things related to custom element into separate file to be imported and reused. Here is simple custom element pc-coverflow-swiper created: <template id="...
latvian's user avatar
  • 3,245
3 votes
0 answers
312 views

I have a custom element that shows a list, where each item is also a component. One team builds the library components - they don't know what each record should look like. A different team uses them ...
Keith's user avatar
  • 157k
1 vote
0 answers
72 views

I am trying to create a webcomponent library based on vue component using defineCustomElement. This is my test component // Test.ce.vue <template> <button @click="onClick"&...
user3641300's user avatar
0 votes
1 answer
103 views

I have a custom HTML element I made that creates a repeating background pattern which I animate in. I need the ability to dynamically set the color of this pattern with a CSS variable that lives in ...
Chris Barr's user avatar
  • 34.7k
1 vote
2 answers
260 views

I created a node package for a Custom Element that I want to use in Angular and React. Therefor, in this library, I do not want specific Angular of React code. My custom element is extending a button: ...
BigJ's user avatar
  • 2,052
5 votes
4 answers
6k views

I have a web component created with Angular 19 prerelease version. It has a liked signal input, which can be set from a parent but can't be modified from within because signal inputs are read only. To ...
Yulia Galiulina's user avatar
0 votes
1 answer
429 views

Tried creating a web component/custom element that would wrap a table from tabulatorjs using svelte, but for some reason can't get the table to properly display. I've followed the docs text and it ...
mr.mhahe's user avatar
0 votes
3 answers
133 views

I have an HTML custom element that inherits from HTMLElement. The template contains: <input type="text" part="input"/> Sample CSS: my-element::part(input) { padding-...
Sideways S's user avatar
1 vote
1 answer
173 views

I'm experimenting with Vanilla custom elements and it doesn't seem possible to slot a style tag: class MyElement extends HTMLElement { constructor() { super(); this.attachShadow({mode: "...
Fravadona's user avatar
  • 17.6k
2 votes
2 answers
371 views

I'm trying to make an HTML page which has the list of all the anime I watched and am about to watch. So, I was trying to make an <anime> tag for convenience purpose. It has name and time ...
Zayaan's user avatar
  • 429
0 votes
0 answers
169 views

I have created a custom element with blazor and I need to call it from another page, but I need to have this blazor custom element on a diferent domain, the problem is when I try to call it from ...
RockoCH's user avatar
  • 21
1 vote
3 answers
634 views

I really think I am really close, but I can't seem to get it to work. Probably something stupid. What I try to do: A client has a WordPress website and I want to embed a piece of Angular inside the ...
Banana828's user avatar
-1 votes
1 answer
100 views

I have a set of basic web components made out of plain JS. Example: Account.ts class Account extends HTMLElement{ constructor(){ super(); this.innerHTML = '<p>My account</p>'...
Oam Psy's user avatar
  • 8,663
0 votes
1 answer
1k views

I have written an Angular custom element like below customElements.define('my-comp', createCustomElement(BasicComponent, config)); and will provide as js file after build using npm run build-elements ...
VKJava's user avatar
  • 83
0 votes
0 answers
245 views

Given the following example in main.ts: import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app....
Mark Hill's user avatar
  • 1,851
0 votes
1 answer
68 views

Is there a way to two-way bind an attribute of a custom HTML element in Blazor? I have a custom element with a value attribute linked to a text input internally that I'd like to bind the value of. <...
jon booraem's user avatar
0 votes
1 answer
68 views

So I'm trying to build this page in a very barebones geocities style server. It lets me use some JS, so I was trying to build some component to do this idea I had, I have built this "blog" ...
GaSab's user avatar
  • 1
3 votes
1 answer
389 views

CSS Nesting With :host Not Working On iOS/OSx While I already solved this issue for myself with a workaround, I bring this up for two reasons... I would like to know if this is actually a bug or not ...
Cody's user avatar
  • 10.1k
2 votes
1 answer
482 views

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

I have standard handlers for the click, input and change events of my customized HtmlInputElement. I want to define these handlers like this: class MyInputElement extends HTMLInputElement { ...
htho's user avatar
  • 1,902
0 votes
0 answers
54 views

Background: Building a Wix app, got a working calendar widget going on this test site but it can't link out after selecting dates due to Wix' iframe sandboxing. They said to use a custom element ...
Ben's user avatar
  • 113
0 votes
2 answers
251 views

I'm trying to dynamically add a custom element I created, but it's not generating them properly. div-item declaration: class Item extends HTMLElement { constructor() { super(); ...
Slothscript's user avatar
0 votes
2 answers
161 views

With Chrome based browsers I would IMPORT a style sheet via: - My component - import sheet from '/Vanilla/ScrollGrid.css' assert {type: 'css'}; or calling user web page - if (userStyles != undefined &...
McMurphy's user avatar
  • 1,505
1 vote
2 answers
473 views

I am trying to use Bootstrap 5 in a Vue 3 Options Api custom element. I have been having issues with loading bootstrap correctly. This is my main.ts file: import { defineCustomElement } from 'vue' ...
purejoymind's user avatar
-1 votes
1 answer
418 views

How can my custom-element / web-component detect a DISABLED attribute change? static get observedAttributes() { return ['checked', 'disabled', 'value']; } My attributeChangedCallback() is not ...
McMurphy's user avatar
  • 1,505
0 votes
0 answers
130 views

I've been trying to expose some functionality of my app to third parties. I think it should be possible to achieve that. Here's what I've done: Created another project in the same workspace, in there ...
Musius's user avatar
  • 95
1 vote
2 answers
238 views

I have custom element which has an input element that is not a first grade child. I want to get the parent custom element from the input and I tried using input.closest() but it does not work with ...
iKingNinja's user avatar
0 votes
0 answers
38 views

When I create a custom element like this: customElements.define( 'my-custom-element', class extends HTMLElement { constructor() { super(); const shadowRoot = this.attachShadow({ ...
Totati's user avatar
  • 1,622
1 vote
1 answer
116 views

TLDR Adding a web component in a pop-out window works as expected in Chrome / Edge. But in Firefox, before I add the web component to the dom it's functioning, but just afterwards it reverts back to ...
mattlag's user avatar
  • 21
0 votes
1 answer
75 views

Here's the test case that I'm confused with. In html (in the end of body): <template id="test"> <test-tag class="test-id"></test-tag> </template> In ...
Abstraction's user avatar
  • 1,662
0 votes
2 answers
94 views

The snippet below spits out an error that CustomElementParent is not defined when I try to extend from it in CustomElementChild. When I remove the ! customElements.get('custom-element-parent') check, ...
Timothy Fisher's user avatar
1 vote
1 answer
69 views

I've crafted a custom built-in element that recursively invokes itself. However, the child elements generated in JavaScript are not inheriting from the custom built-in element. Given that the initial ...
kevin's user avatar
  • 511
2 votes
1 answer
149 views

I created a custom HTML element that creates a new element from the following template: <template id="track"> <div class="record">Nothing yet</div> </...
Alphonsio's user avatar
  • 133
0 votes
1 answer
233 views

EDIT 1 @Danny (and everyone) "Is there a reason your needs to be independent outside the Component? " Please let me explain the use-case here. My custom-element ABC-TOGGLE is (wants to be) ...
McMurphy's user avatar
  • 1,505
0 votes
1 answer
163 views

so I was looking for a way to setup an ES6 'abstract' base class for custom elements, which self-registers (window.customElements.define) upon the first instantiation of a child. The approach I came ...
epanalepsis's user avatar
0 votes
1 answer
116 views

I have a custom HTML element which may group button elements: <custom-element> <button>Foo</button> <button>Bar</button> <button>Baz</button> </...
Armen Michaeli's user avatar
0 votes
2 answers
337 views

EDIT 4 Ok, I hope this additional info seals it. Firefox DOES bubble the synthetic CLICK that I generate on SPACEBAR / ENTER, but it DOES NOT bubble the mouse CLICK. CHROME, OPERA, and EDGE work as ...
McMurphy's user avatar
  • 1,505

1
2 3 4 5
21