Fix auto-populate: use attr() instead of data() for reliable reading
jQuery's data() caches values; attr() reads directly from DOM 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -328,10 +328,11 @@
|
||||
var machineOption = $('#machineid option:selected');
|
||||
var modelOption = $('#modelid option:selected');
|
||||
|
||||
var vendor = modelOption.data('vendor') || '';
|
||||
var model = modelOption.data('model') || '';
|
||||
var machineAlias = machineOption.data('alias') || '';
|
||||
var machineNumber = machineOption.data('number') || '';
|
||||
// Use attr() instead of data() for reliable reading
|
||||
var vendor = modelOption.attr('data-vendor') || '';
|
||||
var model = modelOption.attr('data-model') || '';
|
||||
var machineAlias = machineOption.attr('data-alias') || '';
|
||||
var machineNumber = machineOption.attr('data-number') || '';
|
||||
|
||||
// Only generate if we have model AND (machine OR CSF name)
|
||||
if (!vendor || (!csfName && !machineAlias && !machineNumber)) {
|
||||
|
||||
Reference in New Issue
Block a user