Hi all,
With chrome everything works fine but with safari or edge I get double values in my dropdown, any ideas?
<div class="field">
<div class="ui dropdown">
<input type="hidden" name="group" value="{{group}}">
<i class="dropdown icon"></i>
<div class="default text">{{group}}</div>
<div class="menu">
<div class="item" data-value="Consumer">Consumer</div>
<div class="item" data-value="Contributor">Contributor</div>
<div class="item" data-value="Developer">Developer</div>
<div class="item" data-value="Admin">Admin</div>
<div class="item" data-value="Global auditor">SaaS platform auditor (global display)</div>
</div>
</div>
</div>
chrome:
edge/safari
the double value is also present in the edge DOM
thank you
Any idea maybe? I have the feeling there is a bug in blaze. The only reason I am creating a custom form now is that I got an issue with autoform showing incorrect values. (it copied the value of position 1 in an array to all other documents)…
Ok it works when you do this
<div class="field">
<div class="ui dropdown">
<input type="hidden" name="group" value="{{group}}">
<i class="dropdown icon"></i>
<div class="default text"></div> REMOVE BLAZE {{GROUP}} HERE
<div class="menu">
<div class="item" data-value="Consumer">Consumer</div>
<div class="item" data-value="Contributor">Contributor</div>
<div class="item" data-value="Developer">Developer</div>
<div class="item" data-value="Admin">Admin</div>
<div class="item" data-value="Global auditor">SaaS platform auditor (global display)</div>
</div>
</div>
</div>
ps: it does not work when you remove the whole line of
<div class="default text"></div>
OMG… no now I have the same issue again what I had with autoform. I have 3 customers, each customer can have users. If I change the first user (on position 0 of the array), all other users from other customers change too.
The values are correct in the database (check via mongol), but incorrect in the DOM.
<form class="ui form">
{{#each users}}
{{> updateGroupsFormStep1}}
{{/each}}
</form>
<template name="updateGroupsFormStep1">
<div class="field">
<div class="ui dropdown">
<input type="hidden" name="group" value="{{group}}">
<i class="dropdown icon"></i>
<div class="default text"></div>
<div class="menu">
<div class="item" data-value="Consumer">Consumer</div>
<div class="item" data-value="Contributor">Contributor</div>
<div class="item" data-value="Developer">Developer</div>
<div class="item" data-value="Admin">Admin</div>
<div class="item" data-value="Global auditor">SaaS platform auditor (global display)</div>
</div>
</div>
</div>
</div>
Template.updateGroupsFormStep1.events({
'change' (evt, template) {
var updatedUser = {
name: Template.currentData().name,
group: template.find("[name='group']").value,
country: template.find("[name='country']").value,
};
Meteor.call('updateUserForCustomer', updatedUser);
}
});
Source repo:
and
},
isChrome: function(){ //update screen does not work with edge and firefox because of a bug somehwere
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
console.log('user is using Chrome? ',isChrome);
return isChrome;
}
});
Template.displayUsers.helpers({
selectedCustomerDoc: function() {
// console.log('selectedCustomerStep1 helper doc ', Customers.findOne(Session.get("selectedCustomerStep1")));
return Customers.findOne(Session.get("selectedCustomerStep1"));
},
})
Template.updateUserFormStep1.helpers({
selectedCustomerDoc: function() {
// console.log('selectedCustomerStep1 helper doc ', Customers.findOne(Session.get("selectedCustomerStep1")));
return Customers.findOne(Session.get("selectedCustomerStep1"));
},
})
It looks like blaze is not respecting the scope of the each loop (for each user, print the groups)