Sha256: 62ede483752ef0cefede51fbaebff2e90dbd4bc75e2ffe9432e0ad7e7241f750

Contents?: true

Size: 801 Bytes

Versions: 46

Compression:

Stored size: 801 Bytes

Contents

export const showElement = (elem: any) => {
    elem.style.display = 'block';
    const height = elem.scrollHeight + 'px'; // Get its height
    elem.style.height = height; // Update the max-height
    elem.classList.add('is-visible')
    // Once the transition is complete, remove the inline max-height so the content can scale responsively
    window.setTimeout(() => {
      elem.style.height = '';
    }, 300);
  };

  export const hideElement = (elem:any) => {
    elem.style.height = elem.scrollHeight + 'px';

    window.setTimeout(() => {
      elem.style.height = '0';
      elem.style.paddingTop = '0';
      elem.style.paddingBottom = '0';
    }, 1);

    // When the transition is complete, hide it
    window.setTimeout(() => {
      elem.classList.remove('is-visible');
    }, 300);
  };

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
playbook_ui-13.6.0.pre.alpha.tiptapreacthookformbug1210 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.6.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.5.0.pre.alpha.PLAY823globalpropoverflow1191 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.5.0.pre.alpha.PLAY823globalpropoverflow1188 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.5.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.4.0.pre.alpha.PLAY973Hash1181 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.4.0.pre.alpha.play961turnoffdeprecationwarnings1171 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.4.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.3.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.2.0.pre.alpha.PLAY986dateTimeRounding1150 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.2.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.1.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41129 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41128 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41126 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.0.0.pre.alpha.salesbookmismatchingdate1120 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.39.0.pre.alpha.salesbookmismatchingdate1117 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-13.0.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.39.0.pre.alpha.PLAY966collapsiblenav41115 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.39.0.pre.alpha.salesbookmismatchingdate1114 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts