Comments (2)
I also have the "appending content" problem. But only if I use this library by import "@github/time-elements"
in my bundle.js
which webpack processes. If instead I add <script type="module" src="https://unpkg.com/@github/[email protected]?module"></script>
to my HTML file the problem doesn't appear (both when adding this script tag to <head>
or just before the closing </body>
).
What is weird is that all the steps I can step through with the debugger where something is assigned to this.textContent
assign the correct thing. It is only when we return from https://github.com/github/time-elements/blob/40f3d1abb9a1271607182704fa949b5867f94496/src/local-time-element.ts#L133 (or that is how it looks in the debugger) that the old text content of the tag is added in again.
I think my webpack setup is fairly pedestrian. One thing to note is that I don't have a polyfill installed but I think that is Ok because my browser is Firefox 90.0b10 (64-bit).
The bundle is about 100kB and loaded via <script src="dist/bundle.js"></script>
in the <head>
.
Somehow this feels like there is a race between two things or me not correctly initialising the time-elements library :-/
from relative-time-element.
If you'd like to try the new release I believe this issue is likely fixed. If not let me know and we can revisit it.
from relative-time-element.
Related Issues (20)
- i18n HOT 1
- Error in TypeScript types when using NodeNext module mode HOT 2
- Support providing locale in options HOT 1
- GeasyFork site problem support Waterfox Classic ? HOT 3
- Format attribute does not respect lang HOT 3
- Make `format` API more consistent
- datetime without weekday HOT 2
- Package no longer publishing to NPM? HOT 3
- Not exactly sure of what, but something appears to be wrong?
- Wrong human text HOT 5
- Precision for what to display HOT 3
- The `on` prefix is not localized HOT 3
- Attribute to control which attribute is set for `title` HOT 2
- Text selection bugs in Firefox HOT 5
- Enable passing `formatStyle` to Intl.DateTimeFormat HOT 1
- Stray days added to duration HOT 1
- Stricter `datetime` validation HOT 4
- sdfgvb
- Cannot get format=relative to display seconds HOT 2
- "X years ago" is not rounding correctly HOT 3
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 relative-time-element.