Skip to content

Commit

Permalink
GH-31: Fix the occasionally happening 'cssRules' property issue (GH-32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomVancyan authored Apr 25, 2023
1 parent 69c093a commit ab2d133
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.4",
"version": "0.1.5",
"name": "antd-phone-input",
"description": "Advanced Phone Number Input for Ant Design",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const PhoneInput = (inputLegacyProps: PhoneInputProps) => {

useEffect(() => {
/** Load antd 5.x styles dynamically observing the theme change */
for (let styleSheet of document.styleSheets) {
for (let styleSheet of document?.styleSheets || []) {
let rule: any;
for (rule of styleSheet.cssRules || styleSheet.rules) {
for (rule of styleSheet?.cssRules || styleSheet?.rules || []) {
if (rule.selectorText === ".react-tel-input .country-list") {
rule.style.boxShadow = token.boxShadow;
rule.style.backgroundColor = token.colorBgElevated;
Expand Down

0 comments on commit ab2d133

Please sign in to comment.