@vanilla-bean/components 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -122,7 +122,8 @@ class Router extends Component {
122
122
  }
123
123
 
124
124
  renderView(route = this.route || this.options.defaultPath) {
125
- if (this.currentRoute === route) return;
125
+ // The same route with different parameters (/items/a to /items/b) is a different view
126
+ if (this.currentRoute === route && this.currentPath === this.path) return;
126
127
 
127
128
  this.options.onRenderView?.(route);
128
129
 
@@ -132,6 +133,7 @@ class Router extends Component {
132
133
  if (!this.path) return (this.path = route);
133
134
 
134
135
  this.currentRoute = route;
136
+ this.currentPath = this.path;
135
137
 
136
138
  if (this.options.views[route]) {
137
139
  this.view = new this.options.views[route]({ appendTo: this.elem, ...this.parseRouteParameters() });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-bean/components",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "type": "module",
5
5
  "module": "./index.js",
6
6
  "types": "./index.d.ts",