{"record":{"id":"b74b307dc2deaf8c","repo":"Semantic-Org/Semantic-UI","slug":"element-is-hidden-you-must-call-refresh-after-ele","errorCode":null,"errorMessage":"Element is hidden, you must call refresh after element becomes visible","messagePattern":"Element is hidden, you must call refresh after element becomes visible","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/behaviors/visibility.js","lineNumber":1306,"sourceCode":"  onUnfixed              : function() {},\n\n  // utility callbacks\n  onUpdate               : false, // disabled by default for performance\n  onRefresh              : function(){},\n\n  metadata : {\n    src: 'src'\n  },\n\n  className: {\n    fixed       : 'fixed',\n    placeholder : 'placeholder',\n    visible     : 'visible'\n  },\n\n  error : {\n    method  : 'The method you called is not defined.',\n    visible : 'Element is hidden, you must call refresh after element becomes visible'\n  }\n\n};\n\n})( jQuery, window, document );\n","sourceCodeStart":1288,"sourceCodeEnd":1312,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/behaviors/visibility.js#L1288-L1312","documentation":"Semantic UI Visibility warning logged at visibility.js:101-102 during refresh(): if the element is not currently visible (module.is.visible() returns false), it cannot compute screen position, so it logs this notice telling the developer to call refresh once the element becomes visible (e.g. after a tab switch, modal open, or CSS display change).","triggerScenarios":"Initializing .visibility() on an element inside a hidden tab, accordion section, collapsed modal, or display:none ancestor; toggling visibility at runtime without calling $('.el').visibility('refresh') afterward.","commonSituations":"Lazy-loaded or conditionally-shown content; SPA route changes that show/hide panels; CSS hiding via parent opacity/visibility/display; running visibility init before the layout is rendered.","solutions":["Call $('.el').visibility('refresh') after the element becomes visible (e.g. on tab 'onVisible' callback).","Defer $('.el').visibility() initialization until the parent container is shown.","If the warning is expected in production, set silent:true on visibility settings to suppress it."],"exampleFix":"// before\n$('.ad').visibility(); // parent tab hidden at init\n// after\n$tab.on('click', function(){\n  setTimeout(function(){ $('.ad').visibility('refresh'); }, 0);\n});","handlingStrategy":"validation","validationCode":"function ensureVisibleThenInit($el, opts) {\n  if (!$el.is(':visible')) {\n    var observer = new MutationObserver(function(){\n      if ($el.is(':visible')) { $el.visibility(opts); observer.disconnect(); }\n    });\n    observer.observe(document.body, { attributes: true, subtree: true, attributeFilter: ['class','style','hidden'] });\n    return;\n  }\n  $el.visibility(opts);\n}","typeGuard":"function isElementVisible($el) { return $el.length > 0 && $el.is(':visible'); }","tryCatchPattern":null,"preventionTips":["Call visibility('refresh') from tab/modal 'onVisible' callbacks.","Defer init until the parent container is shown.","Set silent:true once refresh hooks are wired to suppress production noise."],"tags":["semantic-ui","visibility","hidden-element","lifecycle"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}