davidtheclark/no-scroll

Previous styles on documentElement are not restored

Open

#10 建立於 2019年1月2日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)HTML (13 fork)github user discovery
bughelp wanted

倉庫指標

Star
 (244 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I had a use case where the documentElement had inline styles on it, like so: <html style="padding: 0; margin: 0; overflow-x=hidden;">. I noticed that after toggling no-scroll to off, the overflow-x=hidden was being wiped out. After checking the code in no-scroll, I found that it's hard-coding the style attributes when off() is called. I think that no-scroll should be restoring whatever values were set before on() was called, instead of overwriting them.

貢獻者指南